Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将网站重新定向到特定文件夹,以及https_Php_Regex_.htaccess_Mod Rewrite - Fatal编程技术网

Php 将网站重新定向到特定文件夹,以及https

Php 将网站重新定向到特定文件夹,以及https,php,regex,.htaccess,mod-rewrite,Php,Regex,.htaccess,Mod Rewrite,我已经在一个安全的https文件夹中创建了一个新版本的网站,我希望任何请求都能转到该文件夹,因此,例如,将显示 我已经在.htaccess中尝试过,它可以重新定向,但不会更改/屏蔽URL,这要感谢Jan更新了该URL: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https

我已经在一个安全的https文件夹中创建了一个新版本的网站,我希望任何请求都能转到该文件夹,因此,例如,将显示

我已经在.htaccess中尝试过,它可以重新定向,但不会更改/屏蔽URL,这要感谢Jan更新了该URL

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://secure.photofileltd.co.uk/new_site/$1 [L]
任何帮助或建议都将不胜感激-我对htaccess/mod_rewrite一点都不熟悉,谢谢

试试看


重写规则^https://secure.photofileltd.co.uk/new_site%{REQUEST_URI}[R=301,L]

您在途中失去了查询:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://secure.photofileltd.co.uk/new_site/$1 [L]

非常感谢,我已经用我的新代码更新了原来的帖子,但不幸的是现在它变得有点疯狂:似乎在为我工作。给我一对夫妇更多的链接内的网站进行测试。它是?对我来说,它重新指向(你明白了)有趣的是,它在Chrome中工作得很好,但在Firefox中却不是如此。同样,乐观的是,有没有办法屏蔽URL?是的,去掉你的“R”标志。由于重定向已存储一段时间,您是否尝试关闭FF。嗨,尼克,您的htaccess文件中仍然有错误。据我所知,您试图做的是将http内容重定向到名为“new_site”的文件夹中的https内容。对吗?这就是我点击你发布的链接时被重定向到的地方:我认为“安全”不应该在那里,是吗?谢谢你,简-是的,没错,所以->-我不确定这是否可能:$房间里还有别的东西吗?在安全文件夹中是否有另一个?通常情况下,这是完美的。你能编辑你的原始帖子来发布你的htaccess文件的全部内容吗?嗨,尼克,我有点累了,因为我本可以早点看到的。对于地址栏中显示为“您的域”的其他域(包括子域),您需要mod_代理模块()。