简体   繁体   English

子文件夹索引的重写规则

[英]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 这是我的.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? 如何使用正确的htaccess表达式获取所需的网址?

Place this rule in /shiftturn/.htaccess : 将此规则放在/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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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