0
我已經從運行IIS7.5的Windows Server 2008 R2切換到運行Apache2的CentOS服務器,因爲我有PHP性能問題。轉換web.config網址重寫爲.htaccess
我的主站點的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>
所以,它的作用是重寫P =即使用PHP來顯示相應頁面。 那麼,究竟可以做到這一點呢?我不熟悉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=about 應該 http://example.com/about
這是怎麼回事,當我用IIS7.5 URL重寫之前。
任何幫助?