如何使用HTACCESS重定向:
http://www.domain.com/emailreader/10/15/abc
到
http://www.domain.com/emailreader.php?a=10&b=15&c=abc
答案 0 :(得分:1)
通过httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在.htaccess
目录下的DOCUMENT_ROOT
中:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(emailreader)/([^/]+)/([^/]+)/([^/]+)/?$ /$1.php?a=$2&b=$3&c=$4 [L,NC,QSA]
答案 1 :(得分:0)
我觉得这样的事情
RewriteRule ^emailreader/([0-9]+)/([0-9]+)/([a-z]+)$ /emailreader.php?a=$1&b=$2&c=$3 [NC,L]