Hey all,
I have the following code in my .htaccess file for my website.
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z_0-9-]+)$ redirect.php?user=$1
RewriteRule ^([A-Za-z_0-9-]+)/$ redirect.php?user=$1
Now let me explain. I basically host a blog site for a few friends of mine and I make it possible for users to view their blog by visiting www.website.com/username instead of having to go to www.website.com/redirect.php?user=username.
The only problem with this is if somebody types in 'www.website.com/username/' instead of 'www.website.com/username' they will get a 404 error. How should I modify the .htaccess code to alleviate the problem with the extra slash at the end?
I would think that this would work...but the .htaccess files on my server are odd in a sense. I had the feeling it wasn't making a difference, so I removed it using PuTTY ('ls -al' to view the hidden file) and it still redirects correctly (without the ending slash) after the .htaccess is deleted!
What is going on?
thanks, -influx