1

嗨,我想知道我如何编写 htaccess 来制作以下网址:

http://localhost:8000/foo/index.php?pageid=EmpDataEntry

像这样

http://localhost:8000/foo/pageid/EmpDataEntry

谢谢

4

1 回答 1

1

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.

于 2012-04-12T15:26:39.570 回答