2
書き換えルールがありますが、ページがindex.phpでない場合にのみ書き換えルールを実行したい場合は、If文を使用してみました。私のコード、私が試みたもの.htaccess内の特定のファイル名に対してIf文を実行する
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^index$ ./index.php // i did a URL rewrite for removing the .php
<If "%{HTTP_HOST } == 'index'">
// do nothing here else
</If>
<Else> //run the code in the else statement.
RewriteRule^profile.php [NC,L]
RewriteRule ^profile/([0-9a-zA-Z]+) profile.php?id=$1 [NC,L]
RewriteRule^zprofile.php [NC,L]
RewriteRule ^zprofile/([0-9a-zA-Z]+) zprofile.php?id=$1 [NC,L]
</Else>
実際のURLに 'index'を変更します。 – Lag
@Lag応答サーバーエラー。 – Shasha
@ Chris85ありがとう、ありがとう、私は本当に理解していません。 – Shasha