1

我在一个安全的 https 文件夹中创建了一个新版本的网站,我希望任何请求都可以转到该文件夹​​,例如https://photofileltd.co.uk/index.php?page=services然后会显示https ://secure.photofileltd.co.uk/new_site/index.php?page=services

我已经在 .htaccess 中尝试过,它可以很好地重定向,但不会更改/屏蔽 URL,感谢 Jan 进行了更新

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 一点也不熟悉,谢谢!

4

2 回答 2

2

您正在丢失查询:

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

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://secure.photofileltd.co.uk/new_site/$1 [L]
于 2012-04-19T19:07:53.457 回答
1

尝试

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

于 2012-04-19T19:01:49.000 回答