[英]simple htaccess RewriteRule is not working
hello I have urls in this format : http://domain.com/index.php?action=page&name=privacy would like to use domain.com/page/privacy instead of http://domain.com/index.php?action=page&name=privacy using htaccess. 您好,我有以下格式的网址: http ://domain.com/index.php ? action=page&name=privacy想使用domain.com/page/privacy而不是http://domain.com/index.php?使用htaccess的action = page&name = privacy 。 any ideas please 任何想法请
RewriteRule \/index\.php\/(.*)$ /action/$1
You need this rule in your root .htaccess: 您需要在根.htaccess中使用以下规则:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?action=$1&name=$2 [L,QSA]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.