url rewriting problem

url rewriting problem

Posted by: CMMC
Posted on: 2009-02-07 06:35:00

Hello,

I'm going to the wiki but i don't find answer.

Here my htacces :

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /404.php

This code convert my product php in html and that i want !

But when i choose different lang for the product, urlrewrite doesn't work.
I think that doesn't work because i've a double extension (id_lang) on the url i want rewrite : http://mondomain.com/product.php?id_product=13&id_lang=2

I work on Prestashop software and Dreamhost.

Have you some idea for me ? or a code who can disabled urlrewriting when it doesn't work.

Thanks

Re: url rewriting problem

Posted by: Atropos7
Posted on: 2009-02-07 12:40:00

In reply to:

RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]


Looks like someone incorrectly tried to preserve the query string. They need to re-read http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

In particular they deviated from the method used in the other rules.

cool openvein.org -//-

Tags: php in htmlqsacmswikiza