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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.