views:

23

answers:

1

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

+1  A: 

Try this:

RewriteRule ^([^/]+)$ /viewtopic.php?topic=$1 [L]
Detect
where shall i put this at the end
getaway
cheers it works
getaway