Does mod_rewrite work exactly the same on linux and on windows? I have the a rewrite rule, that works perfectly on my local win XP system but won't work when I upload it to my provider (linux machine) I have other rewrite rules running fine locally and on my providers machine I want to change www.mydomain.com/Name__id__545.php to www.mydomain.com/index.php?id=545 here's the rule: RewriteEngine on RewriteRule ^[^\/]*_id_(\d*)\.php$ index.php?id=$1 [L] I tried this to: RewriteRule ^.*_id_(\d*)\.php$ index.php?id=$1 [L] same thing, it works on xp but not on linux. any idea?
Hi. Exactly what do you see when trying to access the mentioned URL (which needs to be rewrited) at your linux machine?
That's what I get: Not Found The requested URL /Firefox1.5.0.1_id_3421.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Got it!! The problem is not the os, it's the apache version. On my local machine I got apache 2.0, my provider has 1.3.26. Apache 1.3.x doesn't support Perl compatible regular expressions (i.e. \d) I changed the RewirteRule to RewriteEngine on RewriteRule ^[^/_]+_id_([0-9]+)\.php$ /index.php?id=$1 [L] and now everything works fine