Jump to content

Simple Rewrite Rule Works Locally But Not On Live


wilsonf1

Recommended Posts

Hi there I have mod_rewrite installed on my apache server, I've successfully got some rewrite rules working but one is just not working! I have a search box that produces a url like this: /search/query-here I have a page called search.php which accepts query strings like q=query-here Here is my rewrite rule that works on my site locally: www-mysite.com:8888

RewriteRule ^search/(.*)$ search\.php?q=$1

Although my search.php is being hit/loaded, no query string is being passed to my live version. When I echo $_SERVER['SCRIPT_FILENAME']. "?".$_SERVER["QUERY_STRING"]; out I get: LOCAL: /search.php?q=aa LIVE: /search.php? Any ideas what I can do?

Link to comment
Share on other sites

That doesn't seem right. You're telling it to add the ?q= to the URL and it's not appearing? Did you try printing the value of $_GET?

print_r($_GET);

Maybe the server is just not setting the QUERY_STRING variable for some reason.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...