PHPでパフォーマンスの問題が発生したため、IIS7.5を実行しているWindows Server2008R2からApache2を実行しているCentOSサーバーに切り替えました。
私のメインサイトのWeb.configはURL書き換えを使用しており、変換する必要があります。最後に.htaccessファイルを使用してからしばらく経ちました。私のWeb.Configリライトコード:
<rule name="IndexRewrite" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?p={R:1}" />
</rule>
つまり、PHPが適切なページを表示するために使用する?p=を書き換えることです。では、これはどのように正確に行うことができますか?私はApache2のmod_rewriteに精通していません。
SocialEngineを使用して別のサイトから書き換えルールを変更しようとしましたが、運が悪かったです。
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Get rid of index.php
RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?p= [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?p= [L,QSA]
</IfModule>
リンクの例: http ://example.com?p= abouthttp ://example.com/aboutで ある必要があります
これが、IIS7.5URLリライトを使用した以前の状態です。
何か助けはありますか?