3 ページのみの動的 URL を持つサイトがあります。そのために、私はphp関数に行きません。そこで、.htaccess 書き換えルールを使用することにしましたが、まだ運がありません。
これは私の実際のURLです:/index.php?mode=service&inid=1
これを次のように書き直します。/home-theater
私はそれを自分で試し、次のコードで試します:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mysite\.com.au$ [NC]
RewriteRule ^(.*)$ http://www.mysite.com.au/$1 [L,R=301]
Options +FollowSymLinks
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.mysite.com.au/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^home-theater/?$ index.php?mode=service&inid=1 [L,NC,QSA]
私はまだそれを機能させることができません。
また、このコードの前にwwwリダイレクトへのindex.phpを書いているので、問題が発生するかどうかは推測できます。index.php から www サイトへのリダイレクトは完全に機能しますが、これは機能しません。