简体   繁体   中英

insert string into url using mod_rewrite

I have a website which has 2 sections and both have a members area. I would like to redirect /members/* to /shop/members/*

Is there a way i can use mod_rewrite to insert the /shop into any url which is /members ?

Try:

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_URI} !(shop/members) [NC]
RewriteRule (.*)?members(\/.*)?$ http://www.yourdomain.com/$1shop/members$2 [R=301]

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