简体   繁体   中英

rewrite rule for subfolder index

i have this url

http://myurl.com/shiftturn/index.php?m=value

and i want:

http://myurl.com/shiftturn/value

this is my .htaccess

RewriteEngine On
RewriteRule /shiftturn/([^/]*)$ /index.php?m=$1 [L]

but doesn't work. how can I do to get the kind of url I need, with a correct htaccess expression?

Place this rule in /shiftturn/.htaccess :

RewriteEngine On
RewriteBase /shiftturn/

RewriteCond %{THE_REQUEST} /index\.php\?m=([^\s&]+) [NC]
RewriteRule ^ %1? [R=302,L,NE]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?m=$1 [L,QSA]

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