URL :http://domainname.com/index.php?p=top-games
これを次のように書き直す必要がありますhttp://domainname.com/top-games
htaccessファイルを使用してこれを行うにはどうすればよいですか? 誰かhtaccessコードを教えてください。
ありがとう
URL :http://domainname.com/index.php?p=top-games
これを次のように書き直す必要がありますhttp://domainname.com/top-games
htaccessファイルを使用してこれを行うにはどうすればよいですか? 誰かhtaccessコードを教えてください。
ありがとう
これを試して:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?p=$1 [QSA,L]
</IfModule
ルート フォルダーに .htaccess ファイルを作成し、コードを貼り付けます
おそらく逆方向へのリダイレクトを探しているでしょう。
このコードをDOCUMENT_ROOT/.htaccess
ファイルに入れます。
RewriteEngine On
# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?p=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L]
# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ /index.php?q=$1 [L,QSA]