0
我通常使用這個htaccess文件從我的網址在ExpressionEngine重定向其中IP是不是&&刪除的index.php
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
AcceptPathInfo On
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
# Looks for files and directories that do not exist
# and provide the segments to the index.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
雖然這一偉大工程,我們進入這個網站投入生產之前刪除的index.php ,我們通過這個htaccess文件
RewriteEngine On
RewriteBase/
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteRule ^(.*)$ http://www.anotherdomain.com/ [R=301,NC]
我自己的IP地址替換localhost的調用,這樣我可以訪問該站點的所有指揮交通,以給定的URL到另一個。
基本上我正在尋找的是這兩個組合,將從我的網址中刪除index.php,但仍然重定向其他人。
感謝, 史蒂芬
不知道你需要什麼,但你說你需要兩個結合 - 那麼,爲什麼你不只是添加了'REMOTE_ADDR上述重寫的條件?我錯過了什麼? –
就是這樣,我試過了。我按照通常的規則添加了我的{REMOTE_ADDR}規則,但即使添加了我的IP地址,我也總是被重定向。 –