Mod_rewrite works on local, not on remote, version?

Posted by TylerT on Stack Overflow See other posts from Stack Overflow or by TylerT
Published on 2011-03-06T16:57:35Z Indexed on 2012/07/11 9:15 UTC
Read the original article Hit count: 197

Filed under:
|
|
|

I have this site. Let's call it htp://www.mysite.com

I have a rewrite rule to change htp://www.mysite.com/?q=words%20etc/0/10 into http://www.mysite.com/words%20etc/0/10 (or http://www.mysite.com//0/10 or http://www.mysite.com/0/10)

.htaccess:ErrorDocument 404 htp://www.mysite.com/404.html
options +FollowSymlinks
rewriteEngine on
rewriteCond %{REQUEST_URI} !-f
rewriteCond %{REQUEST_URI} !-d
rewriteCond %{REQUEST_URI} !index\.php
rewriteRule ^/?([^/]+?)?/?([0-9]+?)/([0-9]+?)$ index.php/%{THE_REQUEST} [NC] 

Now, this works on my local apache 2.2.11 server, no errors. However on my host's apache 1.3.41 server, I get the following error:

[Sat Mar 5 21:42:14 2011] [alert] [client [ip]] /home/_/public_html/mysite.com/.htaccess: RewriteRule: cannot compile regular expression '^/?([^/]+?)?/?([0-9]+?)/([0-9]+?)$'\n 

I imagine it's something quirky about the apache version as other sites on this host use mod_rewrite without a hitch.

I've tried removing the +followSymlinks line, even the rewrite engine line. I haven't tried removing the conditions cause I don't think I should have to, I'm probably wrong.

© Stack Overflow or respective owner

Related posts about regex

Related posts about apache