开发者

rewrite rule problem?

开发者 https://www.devze.com 2023-01-20 13:08 出处:网络
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 i

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

精彩评论

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