0

可能重复:
.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
4

1 回答 1

2

用这个.htaccess

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]

如果您不想重定向但重写使用[PT, L]而不是[R, L]

于 2012-10-07T18:43:06.427 回答