Apache UrlRewrite 一例

<VirtualHost *>
    ServerName www.example.com
    DocumentRoot /www/htdocs/example.com
    ServerAdmin webmaster@example.com
    ErrorLog /www/logs/example.com/error_log
    CustomLog /www/logs/example.com/access_log combined

    RewriteEngine on
    RewriteRule ^/list/([0-9]+)/([0-9]+).html      /www/htdocs/example.com/list.php?type=$1&page=$2
    RewriteRule ^/show/([0-9]+).html                /www/htdocs/example.com/show.php?id=$1
</VirtualHost>

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注