Forum Moderators: phranque

Message Too Old, No Replies

server upgraded to apache 2.2

htaccess not working anymore, help needed to fix

         

silentripper

9:40 am on Apr 4, 2008 (gmt 0)

10+ Year Member



i have simple htaccess rewrite as follows

RewriteEngine on
# REQUEST_URI
RewriteCond %{REQUEST_URI} !^/index.php.*
RewriteRule ^(.*)$ http://www.example.com/index.php/$1 [L]

basically i want
http://www.example.com/abcd.htm
to open as http://www.example.com/index.php/abcd.htm
however the url in the browser must remain the orignal.

this worked fine before, however since my server was upgraded by the hosting guys it no longer works. The redirect is done like it should, however the url on the browser changes as well to http://www.example.com/index.php/abcd.htm.

any help appreciated

[edited by: jdMorgan at 1:53 pm (utc) on April 4, 2008]
[edit reason] example.com [/edit]

jdMorgan

1:54 pm on Apr 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You've apparently got the syntax for an internal rewrite and an external redirect a bit mixed-up, and your new server is no longer as 'forgiving':

RewriteEngine on
#
# Internally rewrite all requests to index.php
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule (.*) /index.php/$1 [L]

Note that the other changes were just to remove unnecessary extra tokens and to escape the literal period in the RewriteCond pattern.

Jim