Jump to content

redirection to index.php always


Alechko

Recommended Posts

Hi guys,

I have a little problem...

 

I wrote this htaccess:

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^(.+)/$ vendor.php?name=$1 [L]
RewriteRule ^cart/([\w\-]+)/$ product.php?name=$1 [L]

 

And I got a problem:

when I'm trying to enter www.domain.com/HP/ It's working. (By the rule of vendor.php).

when I'm trying to enter www.domain.com/cart/product/ - It dosen't working.. It redirects me always to - www.domain.com/cart/product/index.php

And I don't want it.

 

I tried to Options -Indexes and more stuff but nothing was useful.

 

many thanks.

Link to comment
https://forums.phpfreaks.com/topic/265992-redirection-to-indexphp-always/
Share on other sites

The first Rule will also match that second URL you're trying. Stick in an [R] in both Rules to see where you're being redirected to.

 

And switch them around so they're in order of decreasing specificity: the cart/ one first, the catch-all last.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.