Hi, I need my .htaccess to work properly with www.domain.com/search/[B]keyword[/B] and www.domain.com/search/?=[B]keyword[/B] Code (markup): //At this moment works only the part with www.domain.com/search/[B]keyword[/B] //This is the code that I use RewriteRule ^search/(.*)$ /search.php?key=$1 Code (markup): So I need a fix for www.domain.com/search/?=keyword I tried RewriteRule ^search/?=(.*)$ /search.php?key=$1 Code (markup): but is not working Thank you
Mod rewrite tips and tricks; instant 301 from old dynamic url to new static url (will only work if you use the exact variables from the dynamic url).Reg Expression notes: [^&]+ mean find any character except the "&" since it is what seperates the variables in a string. you can back reference matches in a rewrite condition using ()'s just like your rewrite rules but to call them you have to use a % instead of a $. Benefits: 1. You don't have to hand write 1,000's of 301 redirects 2. Spiders can easily pick up the 301 and pass the scores and index the new urls much faster than having to crawl the entire site over from scratch. 3. Users clicking old dynamic urls in the SERPS will not get a 404 error. They'll go straight to the new static urls. Change a product name or change a mispelling and you've just lost all page scores to the static mod rewritten url. Unless... Example url: www.somesite.com/dinnerplates/cassa-stone/ Should be spelled www.somesite.com/dinnerplates/casa-stone/ Make the unormalized, normalized for Yahoo!'s sake. Example code: <a href="some-directory/">some directory</a>Google is very good at indexing and scoring exactly what is in the <a href> tag whether the url is normalized or not. Yahoo on the other hand is a stickler for normalization and will index the example above like so in there SERPS http://www.somesite.com/some-directory
hi I don't need to redirect the pages, only to work both type of links eg www.domain.com/search/keyword and www.domain.com/search/?=keyword At this moment is working only www.domain.com/search/keyword