Hello Everyone, I am trying to make my dynamic pages a little more se friendly and get the session Ids out of the urls. I have two instances that I need to be redirected Current URL: http://www.overdriveelectronics.com...ada91a5d521c82b&category=Portable+Electronics What I want: http://www.overdriveelectronics.com/review/category=Portable+Electronics Also, Current URL: http://www.overdriveelectronics.com/review/review_categories_yahoo_cats2.php?category=Car+Amplifiers What I want: http://www.overdriveelectronics.com/review/category=Car+Amplifiers Can anyone help me out with this? Thanks! If someone is really good at this and would like to earn a few extra bucks, please PM me and I will pay you to create my .htaccess file for this part of my site. Thanks!
Options FollowSymLinks RewriteEngine on RewriteRule ^review/category=([^/=]+)$ review/review_categories_yahoo_cats2.php?category=Portable+Electronics [L,NC]
VimF I tried using the Mod_rewrite Generator on your site. Looks like an awesome tool. However it's not working for my case. I have a search form on my site, so users can search a database of business listings. The form is like this: Then it performs a search and spits out results, the url that it produces in the browser is: Using your generator, it gave me the following: Options FollowSymLinks RewriteEngine On RewriteRule ^search-([^/-]+)-([^/-]+)-([^/-]+)\.html$ search.php?q=$1&x=$2&y=$3& [L,NC] but when doing a search, the urls stay the same. Any advice as to what I'm doing wrong?
You still need to edit your php code, mod_rewrite is only the first part of the job. e.g. Add something like this into your search.php: if (preg_match('/\.php/i', basename($_SERVER['REQUEST_URI']))) { header('HTTP/1.1 301 Moved Permanently'); header('Location: /search-'.preg_replace('/[^\w]+/', '', $q).'.html'); exit(); } PHP: * Fixed an error in my previous post:
one issue somehow when I search for "used cars" or "used-cars" it strips out the space and the '-' and shows as www.mydomain.com/usedcars.htm instead of www.mydomain.com/used-cars.htm or www.mydomain.com/used cars.htm this returns zero results for my query. How can I not have it strip those out?