简体   繁体   中英

How to to shorten a URL using HTACCESS

I have this kind of URL:

http://dev.myproject.local/index.php?route=product/category/feature

and I want to be like this:

http://dev.myproject.local/featurepage

I have this in my htaccess

RewriteEngine On
RewriteRule ^index.php?route=product/category/feature$ /featurepage/ [L]

But it's not working.

You can try following solutions. I used similar last time.

RewriteCond %{THE_REQUEST} \ /index\.php\?_route_=?([^&\ ]*)
RewriteRule ^ /%1? [L,R]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM