


Apache偽靜態html(URL Rewrite)設置
添加時間:2011-2-19
添加:
admin
一、打開 Apache 的配置文件 httpd.conf 。
二、將#LoadModule rewrite_module modules/mod_rewrite前面的#去掉
三、在 httpd.conf中添加:
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteCond %{ENV:_URL} (?:index|dispbbs)[-0-9]+.html
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php?__is_apache_rewrite=1&__rewrite_arg=$2
</IfModule>
四、要實現ASP/' target='_blank' class='infotextkey'>asp帖子URL到php帖子的映射,在 第三步的<IfModule mod_rewrite.c>和</IfModule>之間添加:
RewriteMap tolowercase int:tolower
RewriteCond %{QUERY_STRING} (?:boardid|page|id|replyid|star|skin)=d+ [NC]
RewriteRule ^(.*(?:index|dispbbs)).asp$ $1.php?${tolowercase:%{QUERY_STRING}}&__is_apache_rewrite=1
五、保存httpd.conf并重啟Apache。
關鍵字:Apache 偽靜態 html(URL Rewrite) 設置
新文章:
- CentOS7下圖形配置網絡的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統后丟失windows啟動項
- CentOS單網卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網打印機IP講解
- CentOS7使用hostapd實現無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網絡重啟出錯
- 解決Centos7雙系統后丟失windows啟動項
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統有什么不同呢
- Centos 6.6默認iptable規則詳解