Northern Flame Posted April 1, 2008 Share Posted April 1, 2008 i am creating a membership program and the user profiles will be like myspace, http://www.mysite.com/username i know how to do that, but i want to make exceptions to this, because it messes with the directories. because if i have the directory members and a user signs up as members his URL will be http://www.mysite.com/members but when i try to run http://www.mysite.com/members/ it will not work unless i have the "index.php" added to the URL, how can i make exceptions in the htaccess code? heres my code: RewriteEngine on RewriteRule ^([^/\.]+)/?$ members/profile.php?user=$1 [L] so what i want to do is not run the code above if "user" equals certain things such as members, images, templates, etc. Link to comment https://forums.phpfreaks.com/topic/98910-solved-mod_rewrite-exceptions/ Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 Add these conditions prior to your rule. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Link to comment https://forums.phpfreaks.com/topic/98910-solved-mod_rewrite-exceptions/#findComment-506433 Share on other sites More sharing options...
Northern Flame Posted April 2, 2008 Author Share Posted April 2, 2008 do i add both lines for each sub-directory? Link to comment https://forums.phpfreaks.com/topic/98910-solved-mod_rewrite-exceptions/#findComment-507163 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.