我不是.htaccess方面的专家,我需要一些复杂而棘手的帮助.
这是我当前的.htaccess,请记住我需要一些可以破坏我当前的.htaccess的.htaccess.
当前.htaccess:
RewriteRule ^join$ example/internalpath/join/index.php [L,QSA] RewriteRule ^join/(.*)$ example/internalpath/join/$1 [L,QSA]现在是我的问题:
除了这两个以外,我想将每个文件和目录重定向到HTTP:
example/join/
example/join
请记住,我想让http上的每个链接(除了上面提供的链接之外),否则所有文件和目录,甚至/join/或/join中的文件和目录都将是HTTP,仅是HTTP上的两个链接,但是请不要销毁以前的书面.htaccess.
解决方案您需要以下3条规则:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(join/.+)$ %{HTTP_HOST}/internalpath/$1 [R=301,NC,L] RewriteCond %{HTTPS} off RewriteRule ^(join)/?$ %{HTTP_HOST}/internalpath/$1/index.php [R=301,NC,L] RewriteCond %{HTTPS} on RewriteRule !^join %{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]I am not expert in .htaccess that my need bit complex and tricky help..!
Here is my current .htaccess and remember i need some .htaccess that can destroy my current .htaccess.
Current .htaccess:
RewriteRule ^join$ example/internalpath/join/index.php [L,QSA] RewriteRule ^join/(.*)$ example/internalpath/join/$1 [L,QSA]Now my problem:
I want to redirect each and every file and directories to HTTP, except these two:
example/join/
example/join
Remember, I want every link on http except this above provided link, other then all files and directories and even files and directories in /join/ or /join will be HTTP, just two links on HTTP, but please it will not destroy the previous written .htaccess.
解决方案You need these 3 rules:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(join/.+)$ %{HTTP_HOST}/internalpath/$1 [R=301,NC,L] RewriteCond %{HTTPS} off RewriteRule ^(join)/?$ %{HTTP_HOST}/internalpath/$1/index.php [R=301,NC,L] RewriteCond %{HTTPS} on RewriteRule !^join %{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
更多推荐
.htaccess复杂而棘手的重定向
发布评论