Hello all, Compliments for the great forum. Although its my first post it has helped me a lot in the past! I have a little problem here. These are some of my dynamic urls: http://www.mysite/companysearch/search_result.php?search=Browse&category=painter http://www.mysite/companysearch/search_result.php?search=Browse&category=builder Thats not excactly the urls search engines like! I would love to change it into: http://www.mysite/companysearch/painter.html http://www.mysite/companysearch/builder.html Can somebody help me on this one? Thnx Tatjana
Options +FollowSymLinks RewriteEngine on RewriteRule search_result/(.*)/(.*)/(.*)/(.*)/$ /companysearch/search_result.php?$1=$2&$3=$4 Rewritten URL would be: http://www.mysite/search_result/search/Browse/category/painter/
Thnx for your reply. Its not excactly the rewrite i was looking for. It must be possible i quess to make a rewrite for my examples. So without the "search_result" and the browse Thnx again
domain.com/.htaccess Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^companysearch/([^.]+)\.html$ companysearch/search_result.php?search=Browse&category=$1 [L]
Thnx Nintendo, I think thats what im looking for! But... It still doesnt work. I already have a htaccess file in my root for some permanent redirects. Perhaps thats giving some troubles. Do i have to put this htaccess file in my root folder or in the folder http://www.mysite/companysearch Perhaps i can send u the site so u can see what i mean? Greetz tatjana
That code is for domain.com/.htaccess Post your current .htaccess file If you want it at domain.com/companysearch/.htaccess... Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase /companysearch/ RewriteRule ^([^.]+)\.html$ search_result.php?search=Browse&category=$1 [L] What's the domain name?
Yikes!! LONG .htaccess file!!! Try that .htaccess code in the companysearch/ directory in the last post. Search robots don't use search engines, so they won't even see the links unless you have HTML links pointing to those pages some where. And it won't change the links. The script would have to be changed to point to the new URLs.