Upgrade = mor_rewrite failure,

I upgraded Apache 2.2.14 to 2.2.15. I had working mod_rewrite code, but after the upgrade, it stopped working! :mad: I checked the config to make sure mod_rewrite was on (which it was), and I checked the modules folder for the mod_rewrite module (it was there). I don’t know whats wrong now. Can somebody help?

For a refresher, I want somebody to be able to type “http://localhost/social/USERNAME” and get sent to “http:/localhost/social/user.php?user=USERNAME”. Here is my .htaccess code.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^social/([^/]+)$ social/user.php?user=$1 [L]

Thanks for the help!


Upgrading Apache wouldn’t disable mod_rewrite unless you’ve overwritten the UNcommented LoadModule line (most likely culprit) OR changed the DocumentRoot on your VirtualHost (not so likely with localhost).

As for your code, haven’t we been through this before? Okay, NOT the username is USERNAME so I’ll assume this is all CAPS.

Options +FollowSymLinks
# THAT should be in your httpd.conf
RewriteEngine on
[COLOR="Gray"]RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^social/([A-Z]+)$ social/user.php?user=$1 [L]

As written, there should be NO conflict with existing files and probably no conflict with social’s subdirectories.



I know, but it didn’t work after the upgrade. I did what you said in the last thread, but it doesn’t work.

RewriteEngine on
RewriteRule ^social/([A-Za-z]+)$ social/user.php?user=$1 [L]


PS: The username can be any letter, any case.

I did some troubleshooting, and mod_rewrite doesn’t work if it’s simple. Here is the code I used.

RewriteEngine on
RewriteRule bad\\.html good\\.html [L]

Here is my httpd.conf file.

#LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so

Does anybody know what I am or am not doing? Thanks for the help!



Did you RESTART Apache after uncommenting the mod_rewrite LoadModule statement?

BTW, mod_speling works a treat on simple typos and capitalization errors - you may want to enable that, too!



It has been restarted many time after the change. I also turned on mod_spelling and restarted after that.


What about (in httpd.conf):

<Directory />
    Options FollowSymLinks
    AllowOverride All

Those are also required to run mod_rewrite.