Home php - Weird htaccess mod rewrite acting
Reply: 0

php - Weird htaccess mod rewrite acting

user1901 Published in June 19, 2018, 6:26 pm

I'm trying to set "nice urls" to my website and I have this structure of mod rewrite conditions:

RewriteRule ^/$ /index.php?&%{QUERY_STRING} [L]
RewriteRule ^tabulky-velikosti/?$ tabulky-velikosti.php?&%{QUERY_STRING} [L]
RewriteRule ^o-bambusu/?$ o-bambusu.php?&%{QUERY_STRING} [L]
RewriteRule ^kolekce/?$ kolekce.php?&%{QUERY_STRING} [L]
RewriteRule ^vymena-zbozi/?$ vymena-zbozi.php?&%{QUERY_STRING} [L]
RewriteRule ^doprava-a-platba/?$ doprava-a-platba.php?&%{QUERY_STRING} [L]
RewriteRule ^obchodni-podminky/?$ obchodni-podminky.php?&%{QUERY_STRING} [L]
RewriteRule ^ochrana-osobnich-udaju/?$ ochrana-osobnich-udaju.php?&%{QUERY_STRING} [L]
RewriteRule ^onas/?$ onas.php?&%{QUERY_STRING} [L]
RewriteRule ^contact/?$ kontakt.php?&%{QUERY_STRING} [L]
RewriteRule ^faq/?$ faq.php?&%{QUERY_STRING} [L]

RewriteRule ^kategorie/panske-pradlo/?$ category.php?gender=panske&%{QUERY_STRING} [L]
RewriteRule ^kategorie/damske-pradlo/?$ category.php?gender=damske&%{QUERY_STRING} [L]
RewriteRule ^kategorie/detske-pradlo/?$ category.php?gender=detske&%{QUERY_STRING} [L]

RewriteRule ^(.*)/?$ product.php?url=$1&%{QUERY_STRING} [L]

When I use testing tool (https://htaccess.madewithlove.be), all is good, but when I try to run this on actual website, there is problem with last condition

RewriteRule ^(.*)/?$ product.php?url=$1&%{QUERY_STRING} [L]

It seems that all conditons above are being ignored, for example when I ask for url www.domain.com/contact/, it should show www.domain.com/kontakt.php, but instead of that, it shows page www.domain.com/product.php?url=contact.

When I remove the last line, everything is working as it should.

Can anyone give me some solution to this please? Thanks alot!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.366655 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO