Jnerocorp Posted November 4, 2009 Share Posted November 4, 2009 Hello, I have links like this on my site: its a search so where it says &q=yahoo thats cuz i searched yahoo so that would change depending on what was searched http://joeyelectric.com/search/search.php?cx=008406457722762222407%3Azeakjf5um_o&cof=FORID%3A9&ie=UTF-8&q=yahoo&sa=Search I want them to look like this: I want to make the the url just show the query that was searched but still access the url above ... is this possible? http://joeyelectric.com/search/yahoo -John Quote Link to comment https://forums.phpfreaks.com/topic/180229-help-with-url-hiding/ Share on other sites More sharing options...
Alex Posted November 4, 2009 Share Posted November 4, 2009 You're looking for mod_rewrite Quote Link to comment https://forums.phpfreaks.com/topic/180229-help-with-url-hiding/#findComment-950776 Share on other sites More sharing options...
Jnerocorp Posted November 4, 2009 Author Share Posted November 4, 2009 wow that mod rewrite stuff is difficult im not very sure what apache is or how to use it im guessing i need a code somewhat like this: RewriteRule /search/([i need this to accept all numbers and letters]+) /siteengine/search.php?cx=008406457722762222407%3Azeakjf5um_o&cof=FORID%3A9&ie=UTF-8&q=google&sa=Search but how do i make it so so that it only uses "q=google" for the rewrite? -John Quote Link to comment https://forums.phpfreaks.com/topic/180229-help-with-url-hiding/#findComment-950781 Share on other sites More sharing options...
Jnerocorp Posted November 4, 2009 Author Share Posted November 4, 2009 this is the closest i could get: Options +FollowSymLinks RewriteEngine on RewriteRule search/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /search/search.php?$1=$2&$3=$4&$5=$6&$7=$8&$9=$10 which makes a url like this: http://joeyelectric.com/search/cx/008406457722762222407:zeakjf5um_o/cof/FORID:9/ie/UTF-8/q/how to use mod rewrite/sa/Search/ What i had searched was "how to use mod rewrite" <- which is $8 I want the url to just have $8 Quote Link to comment https://forums.phpfreaks.com/topic/180229-help-with-url-hiding/#findComment-950800 Share on other sites More sharing options...
Dragen Posted November 4, 2009 Share Posted November 4, 2009 RewriteRule /search/([a-z0-9]+)/? /siteengine/search.php?cx=008406457722762222407%3Azeakjf5um_o&cof=FORID%3A9&ie=UTF-8&q=$1&sa=Search Quote Link to comment https://forums.phpfreaks.com/topic/180229-help-with-url-hiding/#findComment-950939 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.