嗨,我想知道我如何编写 htaccess 来制作以下网址:
http://localhost:8000/foo/index.php?pageid=EmpDataEntry
像这样
http://localhost:8000/foo/pageid/EmpDataEntry
谢谢
嗨,我想知道我如何编写 htaccess 来制作以下网址:
http://localhost:8000/foo/index.php?pageid=EmpDataEntry
像这样
http://localhost:8000/foo/pageid/EmpDataEntry
谢谢
Have you read the official mod_rewrite documentation ? Everything is exaplained.
RewriteEngine On
RewriteBase /
RewriteRule ^/foo/pageid/([A-Za-z]+)/?$ /foo/index.php?pageid=$1 [L]
Remove /?
if you don't want to allow a trailing slash.