Options +FollowSymlinks
RewriteEngine On
RewriteBase/
##RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !\.(js|ico|gif|jpg|png|css)$ [NC]
RewriteCond %{REQUEST_FILENAME} !^index.php [NC]
RewriteCond %{REQUEST_FILENAME} !^$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
## RewriteRule ^/([a-zA-Z_+-]+).php$ index.php?p=%1 [R=301]
## RewriteRule ^/?([-a-zA-Z0-9_+]+)$ index.php?p=$1 [R=301,L]
## RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php?b={REQUEST_FILENAME}
RewriteRule * index.php?p={REQUEST_FILENAME} [R=301,L]
上面可以看到我尝试重定向不是现有目录中的任何要求,是不是和的index.php是不是一个静态的资源重定向到index.php 2 P = resourcename国防部重写大部分请求到index.php
我没有任何运气。基本上这样做的目的是将静态和旧的URL重新定向到新的URL,因为我刚刚重写了一个旧网站。
PHP将处理重定向逻辑。
此刻此代码会导致内部服务器错误,因此我认为它是在重定向循环中捕获的。我做错了什么?经过漫长的一天后,我的大脑被炸开了。
谢谢,现在纠正了。它仍然是坏的... – 2009-07-20 14:23:14