可能重复:
.htaccess php 重写
我想从页面重定向:
http://www.bb.com/order/a
至
http://www.bb.com/order?val=a
我怎样才能做到?
UPD。用户将通过第一个链接询问服务器,但响应将通过第二个链接。
UPD2。
RewriteEngine On
RewriteBase /
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^order/(.*)$ order?val=$1 [R, L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress