重定向不适用于 .htaccess
redirect not working with .htaccess
我的 htaccess 中有这个
Options +FollowSymlinks
RewriteEngine On
Deny from all
#RewriteRule (.*) http://google.com [R=301,L]
Allow from 127.0.0.1
Allow from 89.32.93.99
RewriteRule index.php$ /otherfolder [R=301,L]
我正在尝试将所有请求重定向到一个新文件夹,但由于某些原因上述方法不起作用。
我也试过了
Redirect 301 / /otherfolder
但这只是一次又一次地将其他文件夹添加到我的域中,就像这样
mydomain.com/otherfolder/otherfolder/.....
谢谢
保持你的规则如下:
Deny from all
Allow from 127.0.0.1
Allow from 89.32.93.99
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(index\.php)?$ /otherfolder [NC,R=301,L]
^(index\.php)?$
将匹配 /
或 /index.php
in URL.
我的 htaccess 中有这个
Options +FollowSymlinks
RewriteEngine On
Deny from all
#RewriteRule (.*) http://google.com [R=301,L]
Allow from 127.0.0.1
Allow from 89.32.93.99
RewriteRule index.php$ /otherfolder [R=301,L]
我正在尝试将所有请求重定向到一个新文件夹,但由于某些原因上述方法不起作用。
我也试过了
Redirect 301 / /otherfolder
但这只是一次又一次地将其他文件夹添加到我的域中,就像这样
mydomain.com/otherfolder/otherfolder/.....
谢谢
保持你的规则如下:
Deny from all
Allow from 127.0.0.1
Allow from 89.32.93.99
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(index\.php)?$ /otherfolder [NC,R=301,L]
^(index\.php)?$
将匹配 /
或 /index.php
in URL.