Jump to content

Variables are not passed on local server, but work on production server


mattal999

Recommended Posts

Hi,

 

I have this rule:

 

rewriteRule ^download/([0-9]+)$ download.php?id=$1 [L]

Which works on my production server, but not on the local server. The mod_rewrite module is enabled in the httpd.conf and AllowOverride is set to All on the folders.

 

Basically, a URL like download/52 just writes as download.php?id= and the id is not passed. Any ideas?

 

Thanks.

http://new.localhost/download/52

 

The script is located in 'new/' and is called 'download.php'

 

I have a htaccess that rewrites the directory 'new/' to 'http://new.localhost/':

 

rewriteCond %{HTTP_HOST} new.localhost 
rewriteCond %{REQUEST_URI} !new/ 
rewriteRule ^(.*)$ new/$1 [L]

 

To make this work, I added this line in the windows hosts file:

 

127.0.0.1	new.localhost

 

And I can access the site at 'http://new.localhost/' fine.

Yeah thats where it is. I also have the same problem with my search.php rewrite rule: It doesn't pass the variables.

 

The URL used is 'search/123' and it is meant to call 'search.php?q=123' and it is only calling 'search.php?q='.

 

Strange thing is, I tried deleting the entire .htaccess file and if I try going to 'search/123' it STILL returns the search.php page. EVEN after clearing my cache and trying a different browser. I am rather confused.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.