Forum Moderators: phranque

Message Too Old, No Replies

Apache 2 mod rewrite

Getting mod_rewrite to work in Apache 2

         

Samson

1:11 am on Feb 19, 2007 (gmt 0)

10+ Year Member



I have the following .htaccess file defined in the root of my website:


Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([^/\.]+)/projects$ index.php?a=page&p=1
RewriteRule ^([^/\.]+)/links$ index.php?a=page&p=2
RewriteRule ^([^/\.]+)/?$ index.php?a=$1

From everything I've been able to find out about mod_rewrite, that should have worked. I even restarted Apache just to be sure.

But if I put in www.example.net/gallery I get a 404 error instead of the expected page with my picture uploads in it. The same with the other items as well.

I'm running Apache 2.2.3 on Fedora Core 6. The application is written in PHP if that matters. Websites on the server are all handled as name based virtual hosts. File permissions on .htaccess are 0644. I'm sure there must be some kind of really simple thing I'm missing but I can't figure out what it is.

[edited by: jdMorgan at 2:27 pm (utc) on Feb. 19, 2007]
[edit reason] No specifics, please. See Terms of Service. [/edit]

jdMorgan

2:29 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Asking the obvious, here:

What happens if you type "example.com/index.php?a=page&p=1" into your browser -- Does that work?

Jim