Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite backreferences troubles

         

arikgub

9:57 pm on Mar 12, 2006 (gmt 0)

10+ Year Member



Whenever I use backreferences in RewriteRule, mod_rewrite fails.

For example

^abc\.html$ abc.php [L]

works fine. But

^(.*)\.html $1.php [L]

returns error 500.

I am using shared server hosting and don't have access to httpd.conf. Do you have any ideas?

Thanks for help,

Arthur

arikgub

11:08 pm on Mar 12, 2006 (gmt 0)

10+ Year Member



Please ignore my previous post. I've posted oversimplified example that actually works on the server.

The real problem was that I used non-greedy match in RewriteRule. The problem with non-greedy is known and has already been mentioned on WW (for example http://www.webmasterworld.com/forum92/172.htm [webmasterworld.com]).

[edited by: jdMorgan at 12:03 am (utc) on Mar. 13, 2006]
[edit reason] Fixed broken URL formtting. [/edit]