Apache rewrite module, 404 not found

Posted by Eneroth3 on Server Fault See other posts from Server Fault or by Eneroth3
Published on 2012-11-25T21:29:02Z Indexed on 2012/11/25 23:08 UTC
Read the original article Hit count: 263

Filed under:
|

I've been having some problems with rewriting directory styled addresses into query strings for my php scripts. Here's the code

RewriteRule ^(\w+)/?(\w+)?/?(\w+)?/?$ /index.php?section=$1&category=$2&subcategory=$3 [QSA]

This line works perfectly fine on both my local wamp and lamp server, and my friend's lamp server. However on the web hotel I've been using (freehostia) I only get a 404 error when trying to browse a "directory" that isn't really there (supposed to be generated by php). I've tried connecting their support but they only say 3rd party applications aren't their job. I know rewriteEngine is turned on because some basic redirect attempts have worked.

Perhaps this line of code could be better written? It's quite important that extra queries are appended and would be nice (but not necessary) if the last slash could be left out.

Any help is appreciated :)

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-rewrite