开发者

rewrite rule problem?

i have this problem with my url rewrite condition in .htaccess file, everything is 开发者_如何转开发working fine, but when i just type www.example.com on the browser to go to my homepage' it thinks its viewtopic.php file:

my viewtopic files are rewritten to be like this:

www.example.com/topic

this is my code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^user/([^/]*)$ /viewprofile.php?user=$1 [L]
RewriteCond $1 !=viewtopic.php
RewriteRule ^([^/]*)$ /viewtopic.php?topic=$1 [L]

how could i change that so it works normally?:)) thanks


Try this:

RewriteRule ^([^/]+)$ /viewtopic.php?topic=$1 [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜