【发布时间】:2012-12-05 07:35:34
【问题描述】:
这是我当前的 .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-zA-Z-]+)/?$ index.php?u=$1 [L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
它将 www.example.com 变成 example.com 并将 example.com/username 解释为 example.com/ index.php?u=用户名
现在我想传递第二个参数,如 example.com/index.php?u=username&e=email 并仍然保持格式 example.com/arg1&arg2。如何在 .htaccess 中执行此操作?
【问题讨论】:
标签: apache .htaccess url web lamp