Home Htaccess rewrite multiple urls to same file
Reply: 0

Htaccess rewrite multiple urls to same file

Eduardo Pereira
1#
Eduardo Pereira Published in 2017-11-13 20:18:39Z

I'm trying to rewrite these URLs to the same file and just one is working fine.

RewriteRule ^api/cart/?(.*) index.php?$1&route=extension/feed/rest_api/cart [L,QSA] ps: cart is a method inside rest_api file this is working fine

RewriteRule ^api/v2/cart/?(.*)$ index.php?$1&route=extension/feed/rest_api/cartv2 [L,QSA]

ps: cartv2 is another method at same file rest_api

ps2: If I add v2 on URL it stop works.

ps3: If I change this rewrite to RewriteRule ^api/cartv2/?(.*)$ index.php?$1&route=extension/feed/rest_api/cartv2 [L,QSA]

or anything else like RewriteRule ^api/foo/?(.*)$ index.php?$1&route=extension/feed/rest_api/cartv2 [L,QSA]

or RewriteRule ^api/bar/?(.*)$ index.php?$1&route=extension/feed/rest_api/cartv2 [L,QSA]

Works fine.

Could someone help me?

Edit 1: url NOT working: https://www.example.com/api/v2/cart

Full htaccess file: https://pastebin.com/vVVWbJJ0

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO