0

URL をリダイレクトする方法
1. からhttp://www.mysite.com/index.php?page=productおよびhttp://www.mysite.com/product.html

2.

からhttp://www.mysite.com/index.php?page=product&id=example-examplehttp://www.mysite.com/product/example-example.html

4

1 に答える 1

0

mod_rewrite と .htaccess を有効にしてからhttpd.conf、このコードをディレクトリの.htaccess下に配置します。DOCUMENT_ROOT

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^([^.]+)\.html$ /index.php?page=$1 [L,NC,QSA]

RewriteRule ^([^/]+)/([^.]+)\.html$ /index.php?page=$1&id=$2 [L,NC,QSA]
于 2013-09-20T09:01:13.980 に答える