PHP page rewrites done, now what does it look like?

Discuss practical ways rearrange URLs using mod_rewrite.

Postby servantofgod » Mon Oct 06, 2008 12:04 pm

Sorry,

Let me be more descriptive. These relates back to the last changes I made, inputing product names into the url using this rewrite:
Code: Select all
RewriteRule ^.+products-ban-([0-9]+)-cat-(.*)\.php$                     /products.php?ban=$1&cat=$2                            [QSA,L]


This allowed product names to be inserted into the url, there was only one problem. If the product name had a backslash say for example:

Nice dress w/ Sash


It would lead to a screwed up version of the page it was supposed to go to. How can I get it to accept all characters, including backslashes, before the dash before 'product' so that it does not distort the page.

Thanks, Rich. I hope I explained that right!
servantofgod
 
Posts: 22
Joined: Wed Oct 01, 2008 8:14 am
Location: Chicago

Postby richardk » Mon Oct 06, 2008 1:31 pm

It would lead to a screwed up version of the page it was supposed to go to.

No images and/or CSS? It's almost certainly because of relative paths, see: Relative paths to images, JavaScript, CSS and other external/linked files are broken.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 22 guests

cron