我想要一个htaccess modrewrite规则来重定向,我已经创建了自己的规则,但是它一次又一次地重定向,并且从循环中重定向,所以它不能在我这边工作。
http://freemp3tx.com/anything至http://freemp3tx.com/anything-mp3-download.html
htaccess文件:
DirectoryIndex home.php
RewriteEngine On
RewriteRule ^(.*)-mp3-download.html$ index.php?search=$1 [L]
答案 0 :(得分:0)
如果您想从anything
重定向到anything-mp3-download.html
,则必须使用RewriteCond
RewriteEngine On
RewriteCond %{REQUEST_URI} !-mp3-download.html$
RewriteRule .* $0-mp3-download.html [L]