I have this in my 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]
I am trying to redirect all the requests to a new folder but for some reason the above does not work.
I have also tried
Redirect 301 / /otherfolder
but that just added other folder again and again to my domain like this
mydomain.com/otherfolder/otherfolder/.....
thanks
答案 0 :(得分:1)
保持这样的规则:
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
。