Apache RewriteRule not rewriting as expected

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2013-10-23T21:33:58Z Indexed on 2013/10/23 21:54 UTC
Read the original article Hit count: 153

Filed under:
|

Can you any one see anything wrong with the following apache rewrite rule:

This is in my .htaccess file inside a folder called "text" a subdirectory of localhost/lombardpress I have the following rule

Options +FollowSymlinks
RewriteEngine on
RewriteRule ([^/]+) /textdisplay.php?fs=$1 [NC]

I was expecting this input:

http://localhost/lombardpress-dev/text/lectio1

to rewrite to this:

http://localhost/lombardpress-dev/text/textdisplay?fs=lectio1

But instead I get a 404 error.

The requested URL /textdisplay.php was not found on this server.

It looks to me like the RewriteRule has re-written the address but not as I intended - so there must be something wrong with my regular expression.

Let me know if I can provide further information.

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite