2016-09-22 92 views
0

我改变了我的.htaccess来制作漂亮的网址。 这是怎么回事?RewriteRule .htaccess不能正常工作

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([a-zA-Z0-9-/]+).html$ article.php?url=$1 [NC,L] 
RewriteRule ^([a-zA-Z0-9-/]+).html/$ article.php?url=$1 [NC,L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^category/([a-zA-Z0-9-/]+).html$ category.php?cat=$1 [NC,L] 
RewriteRule ^category/([a-zA-Z0-9-/]+).html/$ category.php?cat=$1 [NC,L] 

,我从这个 .htaccess rewriteRule conflict

了我会做出这样的

localhost/category/bla.html 

localhost/seo/bla.html 

,这是数据库的URL

bla.html 
seo/bla-bla.html 
+0

什么网址你试图实现什么是原始网址请提及seperatly。 –

+0

谢谢,我已经完成了。 –

回答

1

才刚刚动底部部分向上

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^category/([a-zA-Z0-9-/]+).html$ category.php?cat=$1 [QSA,L] 
RewriteRule ^category/([a-zA-Z0-9-/]+).html/$ category.php?cat=$1 [QSA,L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([a-zA-Z0-9-/]+).html$ article.php?url=$1 [L,QSA] 
RewriteRule ^([a-zA-Z0-9-/]+).html/$ article.php?url=$1 [L,QSA] 
相关问题