0

.htaccess を使用して自分の URL を SEO に適した URL に変換するにはどうすればよいですか?

このような元のURL:

http://palestinianz.com/?page=person&p=10

http://palestinianz.com/?page=persons&c=10

最初のリンクの書き換えられた URL は次のとおりです。

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /?page=$1&p=$2 [L]

最初のリンクの結果:

http://palestinianz.com/person/10.html

書き換えられた URL にリダイレクト ルールを書き込む方法を教えてください。

4

1 に答える 1

0

It looks like you need to apply my previous answer, changing the person to persons and the p to c:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /\?page=persons&c=([^\ ]+)
RewriteRule ^$ /persons/%1.html? [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /\?page=person&p=([^\ ]+)
RewriteRule ^$ /person/%1.html? [R=301,L]

and back

RewriteRule ^persons/([^/]*)\.html$ /?page=persons&c=$1 [L]
RewriteRule ^person/([^/]*)\.html$ /?page=person&p=$1 [L]
于 2012-08-08T18:22:58.133 に答える