You are here:  » Update Rewrite Rules

Support Forum



Update Rewrite Rules

Submitted by technoarenasol on Fri, 2012-11-09 13:22 in

Hi David

I want to rewrite Rules for some URL

http://example.com/mobile/search.php?q=%3A&brandFilter[]=Samsung
http://example.com/mobile/search.php?q=%3A&brandFilter[]=lg

Thanks
Amin

Submitted by support on Fri, 2012-11-09 13:32

Hi Amin,

Sure - let's say you want to rewrite

/mobile/samsung

to

/mobile/search.php?q=%3A&brandFilter[]=Samsung

In your /mobile/.htaccess file, add the following line to the end:

RewriteRule ^samsung$ search.php?q=bw:&brandFilter[]=Samsung&rewrite=1&%{QUERY_STRING} [L]

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Sat, 2012-11-10 06:09

technoarenasol

Thanx David .Its works now but when click on next page than display page not found

check this http://www.example.com/mobile/brand/samsung

Submitted by support on Sat, 2012-11-10 09:30

Hi Amin,

If you're happy to use /brand/samsung/ (i.e a "/" on the end) this is actually rewritten by the built in rules so there would be no need for your custom rule; and from that URL the navigation and change sort links still work.

However if you would like to keep it up a level and use /brand/samsung then if you remove the rewrite=1 from the rule e.g.

RewriteRule ^samsung$ search.php?q=bw:&brandFilter[]=Samsung&%{QUERY_STRING} [L]

...then the sort and navigation links will work as normal...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Sat, 2012-11-10 10:43

technoarenasol

Hi David

next page working now but in next page remove filter display 2 times

Submitted by support on Sat, 2012-11-10 11:09

Hello Amin,

Because you're using a non-rewrite URL not ending in "/" html/navigation.php should be updated to ensure that non-rewrite navigation links go to search.php.

To do this, in html/navigation.php use the Search and Replace function of your Text Editor to change the file as follows:

Search:

"?q="

Replace:

$config_baseHREF."search.php?q="

Cheers,
David.
--
PriceTapestry.com