Re: .htaccess rule match keyword

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Feb 6, 2017 at 11:34 AM, Rajib Karmakar
<creativeweblogo@xxxxxxxxx> wrote:
>
> RewriteRule ^cart(.*)$ cart.php
>
> https://www.berkshirefurniture.com/cart/
[]
>
> https://www.berkshirefurniture.com/carter-upholstered-bed/p/bmV3LWFycml2YWw=
>
> ## For showing leaf sub category of item
> RewriteCond %{REQUEST_URI} !^/([^/]*)/p
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^([^/]*)/([^/]*)/([^/]*)$
> leafsub-category-gallery.php?slug=$1&subcat=$2&leafsubcat=$3 [L,NC]
>
> First four letter of products url "carter" to "cart" matched with the cart
> page link and that's the reason it moved to the cart page.
>
> Is it possible using htaccess rewriting match the specific slug and forced
> not to redirect it's default rules i.e it matched the full slug and redirect
> to specific rule only.

Not sure what you mean, but as already suggested, why not avoid
matching anything but /cart or /cart/.* in the first place:
    RewriteRule ^cart(/|$) cart.php
?

And shouldn't the same principle also apply to the first RewriteCond:
   RewriteCond %{REQUEST_URI} !^/([^/]*)/p/
?


Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux