OK so I want to let my users have a top-level subdomain, for example http://www.domain.com/username I want to change it from index.php?view=view_profile.php&user=username Thing is, I want it to be able to work for both http://www.domain.com/username and one with a trailing slash http://www.domain.com/username/ I got the one with a trailing slash to work, but I can't seem to get the one without a trailing slash to work. Anyway to do this?
this is all there is RewriteEngine On RewriteRule ^(.*)/ /index.php?view=view_profile.php&user=$1 Code (markup): I tried adding RewriteRule ^(.*) /index.php?view=view_profile.php&user=$1 But this gives me a 500 internal server error.
Dig deeper into this forum, Nintendo gave the solution to another member trying to do the same. Sorry, don't remember how to give you a replica of such coding.
Where you are getting 500 Internal server error, you are actually creating an infinite loop. Use this instead: RewriteEngine On RewriteCond %{REQUEST_URI} !^/index.php RewriteRule ^/([^/]+)/?$ /index.php?view=view_profile.php&user=$1 Code (markup): RewriteCond will stop the rewriting process after first pass (otherwise apache continues rewriting again and again since RewriteRule matches everytime). It will match with and without trailing slash.