...

View Full Version : Need help with .htaccess rewrite rule



kalseo
07-16-2010, 05:11 AM
Hi codingforums friends,

I need help with rewrite rule as my website looks not SE friendly now. It is all dynamic URLs and I am unable to figure out how to rewrite it properly.

This is my website topnamebrands.net

The links for the brands look like:

http://www.topnamebrands.net/?filter=%3AGucci%3A

And the different categories like:

http://www.topnamebrands.net/?filter=%3AGucci%3ADresses

And if go deeper is:

http://www.topnamebrands.net/?product=_id_4766

What rule to apply to have something that look like:

topnamebrands.net/Gucci/
topnamebrands.net/Gucci/dresses/

this is just an example, it can look different, but similar.

Thank you for your help!

Kind regards

Kal

Saeid
07-16-2010, 03:14 PM
I am not an expert, but this site helped me to write my rules.

http://www.generateit.net/mod-rewrite/

make sure yuo first have your links like what you want to be INSIDE your codes.

Inigoesdr
07-17-2010, 07:27 PM
Try something like this:

RewriteEngine On
RewriteCond %{REQUEST_URI} -f
RewriteCond %{REQUEST_URI} -d
RewriteRule ^/(.*)$ /?filter=$1 [L]

You will have to update your script to accept filters with slashes instead of colons in this case, but you can get more specific and tweak it to your liking if that is a problem.

santhoshj400
07-21-2010, 11:13 AM
Hi To enable mod_rewrite in xampp first go to the directory of installation <xampp-directory>\apache\conf and edit httpd.conf. Find the line which contains
#LoadModule rewrite_module modules/mod_rewrite.so
uncomment this(should be):

LoadModule rewrite_module modules/mod_rewrite.so

Also find AllowOverride None

Should be:

AllowOverride All

Thanks & Regards
Santhosh
I really think it appears 2 times and later restart the apache .....



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum