我在.htaccess中有一些行,我试图拼合URL,但似乎我错过了一些东西。 URL被重定向,但大部分资源在URL被重定向时都是“未找到”。.htaccess使用三个查询字符串重定向url
这是代码。
Options -Indexes +FollowSymLinks
RewriteEngine On
###########music#######
RewriteCond %{THE_REQUEST} \ /+profile\.php\?user=([^&]+)&title=([^&]+)&uid=([^&\ ]+)
RewriteRule^/%1/%2/%3? [L,R=301]
RewriteCond %{THE_REQUEST} \ /+profile\.php\?user=([^&]+)&title=([^&\ ]+)
RewriteRule^/%1/%2? [L,R=301]
#################internally redirect////////////
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ profile.php?user=$1&title=$2&uid=$3 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)$ profile.php?user=$1&title=$2 [L,QSA]
我在做什么错?
所有行都有注释。哪些网址不适合你? – anubhava 2014-12-03 06:24:41
看到这个问题,以启用重写跟踪,这可能会帮助你找到什么是错的:http://stackoverflow.com/questions/7738170/how-to-debug-htaccess-rewrite-script – Sheepy 2014-12-03 06:28:09
@anubhava,我的错误。请再看一遍。 – Relm 2014-12-03 06:42:14