(康盛产品)如何在Apache环境下配置Rewrite规则

(康盛产品)如何在Apache环境下配置Rewrite规则,第1张

概述URL 静态化是一个利于搜索引擎的设置,通过 URL 静态化,达到原来是动态的 PHP 页面转换为静态化的 HTML 页面,当然,这里的静态化是一种假静态,目的只是提高搜索引擎的搜索量,Comsenz 旗下的产品 Discuz!、SupeSite/X-Space、ECShop、SupeV、UCHome 等都支持此功能。当然这个功能还需要服务器环境的支持,下面介绍一下如何在 Apache 服务器下配置 URL 静态化的 Rewrite 规则。当然这里分两种情况,一种是独立主机用户,这部分用户拥有对主机的管理权限,因此配置起来比较方便一些。(注:这里就以 Discuz!6.1.0 的 Rewrite 规则为例,稍后在后面会列举出其他产品的 Rewrite 规则。首先确定您使用的 Apache 版本,及是否加载了 mod_Rewrite 模块。Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码:LoadModule Rewrite_module libexec/mod_Rewrite.soAddModule mod_Rewrite.cApache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码:LoadModule Rewrite_module modules/mod_Rewrite.so如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即 <VirtualHost> 中去,如果加在虚拟主机配置外部将可能无法使用,改好后将 Apache 重启。<IfModule mod_Rewrite.c>RewriteEngine OnRewriteRule ^(.*)/archiver/((fid|tid)-[w-]+.html)$ $1/archiver/index.php?$2RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3RewriteRule ^(.*)/space-(username|uid)-(.+).html$ $1/space.php?$2=$3RewriteRule ^(.*)/tag-(.+).html$ $1/tag.php?name=$2</IfModule>如果没有安装 mod_Rewrite,您可以重新编译 Apache,并在原有 configure 的内容中加入 --enable-Rewrite=shared,然后再在 Apache 配置文件中加入上述代码即可。另外一种用户是 Apache 虚拟主机用户。在开始以下设置之前,请首先咨询您的空间服务商,空间是否支持 Rewrite 以及是否支持对站点目录中 .htaccess 的文件解析,否则即便按照下面的方法设置好了,也无法使用。检查论坛所在目录中是否存在 .htaccess 文件,如果不存在,请手工建立此文件。Win32 系统下,无法直接建立 .htaccess 文件,您可以从其他系统中拷贝一份,或者在 Discuz.net 技术支持栏目中下载此文件。编辑并修改 .htaccess 文件,添加以下内容:# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /RewriteBase /discuz# Rewrite 系统规则请勿修改RewriteRule ^archiver/((fid|tid)-[w-]+.html)$ archiver/index.php?$1RewriteRule ^forum-([0-9]+)-([0-9]+).html$ forumdisplay.php?fid=$1&page=$2RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ viewthread.php?tid=$1&extra=page%3D$3&page=$2RewriteRule ^space-(username|uid)-(.+).html$ space.php?$1=$2RewriteRule ^tag-(.+).html$ tag.php?name=$1添加内容时,请遵照上面的提示,修改论坛所在的路径,然后保存。将 .htaccess 文件上传到论坛所在的目录中。然后进入论坛系统设置的搜索引擎优化,根据需要开启 URL 静态化功能。下面简单介绍一些其他产品的 Rewrite 规则。SupeSite/X-Space6.0 UC规则Apache 独立主机用户:<IfModule mod_Rewrite.c>RewriteEngine On###Rewrite 系统规则请勿修改RewriteRule ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2 [L]RewriteRule ^/([0-9]+)/viewspace(.+)$ /index.php?uid/$1/action/viewspace/itemid$2 [L]RewriteRule ^/([0-9]+)/viewbbs(.+)$ /index.php?uid/$1/action/viewbbs/tid$2 [L]RewriteRule ^/([0-9]+)/(.*)$ /index.php?uid/$1/$2 [L]RewriteRule ^/([0-9]+)$ /index.php?uid/$1 [L]RewriteRule ^/action(.+)$ /index.php?action$1 [L]RewriteRule ^/category(.+)$ /index.php?action/category/catid$1 [L]RewriteRule ^/viewnews(.+)$ /index.php?action/viewnews/itemid$1 [L]RewriteRule ^/viewthread(.+)$ /index.php?action/viewthread/tid$1 [L]RewriteRule ^/mygroup(.+)$ /index.php?action/mygroup/gid$1 [L]</IfModule>Apache 虚拟主机用户:### 将 RewriteEngine 模式打开RewriteEngine On### 修改以下语句中的 /SupeSite 修改为你的SupeSite目录地址,如果程序放在根目录中,请将 /SupeSite 修改为 /RewriteBase /### Rewrite 系统规则请勿修改RewriteRule ^([0-9]+)/spacelist(.+)$ index.php?uid/$1/action/spacelist/type$2 [L]RewriteRule ^([0-9]+)/viewspace(.+)$ index.php?uid/$1/action/viewspace/itemid$2 [L]RewriteRule ^([0-9]+)/viewbbs(.+)$ index.php?uid/$1/action/viewbbs/tid$2 [L]RewriteRule ^([0-9]+)/(.*)$ index.php?uid/$1/$2 [L]RewriteRule ^([0-9]+)$ index.php?uid/$1 [L]RewriteRule ^action(.+)$ index.php?action$1 [L]RewriteRule ^category(.+)$ index.php?action/category/catid$1 [L]RewriteRule ^viewnews(.+)$ index.php?action/viewnews/itemid$1 [L]RewriteRule ^viewthread(.+)$ index.php?action/viewthread/tid$1 [L]RewriteRule ^mygroup(.+)$ index.php?action/mygroup/gid$1 [L]ECShop2.6.0 规则Apache 独立主机用户:<IfModule mod_Rewrite.c>RewriteEngine OnRewriteRule ^(.*)/index.html$ $1/index.phpRewriteRule ^(.*)/category$ $1/index.php [L]RewriteRule ^(.*)/feed-c([0-9]+).xml$ $1/feed.php?cat=$2 [L]RewriteRule ^(.*)/feed-b([0-9]+).xml$ $1/feed.php?brand=$2 [L]RewriteRule ^(.*)/feed.xml$ $1/feed.phpRewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$ $1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*).html$ $1/category.php?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$ $1/category.php?id=$2&brand=$3&page=$4&sort=$5&order=$6RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$ $1/category.php?id=$2&brand=$3&page=$4RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*).html$ $1/category.php?id=$2&brand=$3RewriteRule ^(.*)/category-([0-9]+)(.*).html$ $1/category.php?id=$2RewriteRule ^(.*)/goods-([0-9]+)(.*).html$ $1/goods.php?id=$2RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$ $1/article_cat.php?id=$2&page=$3&sort=$4&order=$5RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*).html$

<p >URL 静态化是一个利于搜索引擎的设置,通过 URL 静态化,达到原来是动态的 PHP 页面转换为静态化的 HTML 页面,当然,这里的静态化是一种假静态,目的只是提高搜索引擎的搜索量,Comsenz 旗下的产品 discuz!、SupeSite/X-Space、ECShop、SupeV、UCHome 等都支持此功能。当然这个功能还需要服务器环境的支持,下面介绍一下如何在 Apache 服务器下配置 URL 静态化的 Rewrite 规则。


<p >当然这里分两种情况,一种是独立主机用户,这部分用户拥有对主机的管理权限,因此配置起来比较方便一些。(注:这里就以 discuz!6.1.0 的 Rewrite 规则为例,稍后在后面会列举出其他产品的 Rewrite 规则。


<p >


<p >首先确定您使用的 Apache 版本,及是否加载了 mod_Rewrite 模块。


<div >Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码:
<div >
LoadModule Rewrite_module libexec/mod_Rewrite.so
AddModule mod_Rewrite.c

<p >Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码:


<p >LoadModule Rewrite_module modules/mod_Rewrite.so


<p >如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即 中去,如果加在虚拟主机配置外部将可能无法使用,改好后将 Apache 重启。


<div >

RewriteEngine On
RewriteRule ^(.)/archiver/((fID|tID)-[\w-]+.HTML)$ $1/archiver/index.PHP?$2
RewriteRule ^(.
)/forum-([0-9]+)-([0-9]+).HTML$ $1/forumdisplay.PHP?fID=$2&page=$3
RewriteRule ^(.)/thread-([0-9]+)-([0-9]+)-([0-9]+).HTML$ $1/vIEwthread.PHP?tID=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.
)/space-(username|uID)-(.+).HTML$ $1/space.PHP?$2=$3
RewriteRule ^(.*)/tag-(.+).HTML$ $1/tag.PHP?name=$2

# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /RewriteBase /discuz# Rewrite 系统规则请勿修改RewriteRule ^archiver/((fID|tID)-[\w\-]+\.HTML)$ archiver/index.PHP?$1RewriteRule ^forum-([0-9]+)-([0-9]+)\.HTML$ forumdisplay.PHP?fID=$1&page=$2RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.HTML$ vIEwthread.PHP?tID=$1&extra=page\%3D$3&page=$2RewriteRule ^space-(username|uID)-(.+)\.HTML$ space.PHP?$1=$2RewriteRule ^tag-(.+)\.HTML$ tag.PHP?name=$1

RewriteEngine On###Rewrite 系统规则请勿修改RewriteRule ^/([0-9]+)/spaceList(.+)$ /index.PHP?uID//action/spaceList/type [L]RewriteRule ^/([0-9]+)/vIEwspace(.+)$ /index.PHP?uID//action/vIEwspace/itemID [L]RewriteRule ^/([0-9]+)/vIEwbbs(.+)$ /index.PHP?uID//action/vIEwbbs/tID [L]RewriteRule ^/([0-9]+)/(.*)$ /index.PHP?uID// [L]RewriteRule ^/([0-9]+)$ /index.PHP?uID/ [L]RewriteRule ^/action(.+)$ /index.PHP?action [L]RewriteRule ^/category(.+)$ /index.PHP?action/category/catID [L]RewriteRule ^/vIEwnews(.+)$ /index.PHP?action/vIEwnews/itemID [L]RewriteRule ^/vIEwthread(.+)$ /index.PHP?action/vIEwthread/tID [L]RewriteRule ^/mygroup(.+)$ /index.PHP?action/mygroup/gID [L]

### 将 RewriteEngine 模式打开RewriteEngine On### 修改以下语句中的 /SupeSite 修改为你的SupeSite目录地址,如果程序放在根目录中,请将 /SupeSite 修改为 /RewriteBase /### Rewrite 系统规则请勿修改RewriteRule ^([0-9]+)/spaceList(.+)$ index.PHP?uID/$1/action/spaceList/type$2 [L]RewriteRule ^([0-9]+)/vIEwspace(.+)$ index.PHP?uID/$1/action/vIEwspace/itemID$2 [L]RewriteRule ^([0-9]+)/vIEwbbs(.+)$ index.PHP?uID/$1/action/vIEwbbs/tID$2 [L]RewriteRule ^([0-9]+)/(.*)$ index.PHP?uID/$1/$2 [L]RewriteRule ^([0-9]+)$ index.PHP?uID/$1 [L]RewriteRule ^action(.+)$ index.PHP?action$1 [L]RewriteRule ^category(.+)$ index.PHP?action/category/catID$1 [L]RewriteRule ^vIEwnews(.+)$ index.PHP?action/vIEwnews/itemID$1 [L]RewriteRule ^vIEwthread(.+)$ index.PHP?action/vIEwthread/tID$1 [L]RewriteRule ^mygroup(.+)$ index.PHP?action/mygroup/gID$1 [L]

RewriteEngine OnRewriteRule ^(.*)/index.HTML$ /index.PHP RewriteRule ^(.*)/category$ /index.PHP [L]RewriteRule ^(.*)/Feed-c([0-9]+).xml$ /Feed.PHP?cat= [L]RewriteRule ^(.*)/Feed-b([0-9]+).xml$ /Feed.PHP?brand= [L]RewriteRule ^(.*)/Feed.xml$ /Feed.PHPRewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ /category.PHP?ID=&brand=&price_min=&price_max=&filter_attr=&page=&sort=&order=RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.HTML$ /category.PHP?ID=&brand=&price_min=&price_max=&filter_attr=RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ /category.PHP?ID=&brand=&page=&sort=&order=RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.HTML$ /category.PHP?ID=&brand=&page=RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.HTML$ /category.PHP?ID=&brand=RewriteRule ^(.*)/category-([0-9]+)(.*)\.HTML$ /category.PHP?ID=RewriteRule ^(.*)/goods-([0-9]+)(.*)\.HTML$ /goods.PHP?ID=RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ /article_cat.PHP?ID=&page=&sort=&order=RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.HTML$ /article_cat.PHP?ID=&page=RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.HTML$ /article_cat.PHP?ID=RewriteRule ^(.*)/article-([0-9]+)(.*)\.HTML$ /article.PHP?ID=RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.HTML /brand.PHP?ID=&cat=&page=&sort=&order=RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.HTML /brand.PHP?ID=&cat=&page=RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.HTML /brand.PHP?ID=&cat=RewriteRule ^(.*)/brand-([0-9]+)(.*)\.HTML /brand.PHP?ID=RewriteRule ^(.*)/tag-(.*)\.HTML /search.PHP?keywords=RewriteRule ^(.*)/snatch-([0-9])\.HTML$ /snatch.PHP?ID=RewriteRule ^(.*)/group_buy-([0-9])\.HTML$ /group_buy.PHP?act=vIEw&ID=

RewriteEngine On#RewriteBase /# direct one-word accessRewriteRule ^index\.HTML$ index\.PHP [L]RewriteRule ^category$ index\.PHP [L]# access any object by its numeric IDentifIErRewriteRule ^Feed-c([0-9]+)\.xml$ Feed\.PHP\?cat=$1 [L]RewriteRule ^Feed-b([0-9]+)\.xml$ Feed\.PHP\?brand=$1 [L]RewriteRule ^Feed\.xml$ Feed\.PHP [L]RewriteRule ^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ category\.PHP\?ID=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 [QSA,L]RewriteRule ^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.HTML$ category\.PHP\?ID=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 [QSA,L]RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ category\.PHP\?ID=$1&brand=$2&page=$3&sort=$4&order=$5 [QSA,L]RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.HTML$ category\.PHP\?ID=$1&brand=$2&page=$3 [QSA,L]RewriteRule ^category-([0-9]+)-b([0-9]+)(.*)\.HTML$ category\.PHP\?ID=$1&brand=$2 [QSA,L]RewriteRule ^category-([0-9]+)(.*)\.HTML$ category\.PHP\?ID=$1 [QSA,L]RewriteRule ^goods-([0-9]+)(.*)\.HTML$ goods\.PHP\?ID=$1 [QSA,L]RewriteRule ^article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.HTML$ article_cat\.PHP\?ID=$1&page=$2&sort=$3&order=$4 [QSA,L]RewriteRule ^article_cat-([0-9]+)-([0-9]+)(.*)\.HTML$ article_cat\.PHP\?ID=$1&page=$2 [QSA,L]RewriteRule ^article_cat-([0-9]+)(.*)\.HTML$ article_cat\.PHP\?ID=$1 [QSA,L]RewriteRule ^article-([0-9]+)(.*)\.HTML$ article\.PHP\?ID=$1 [QSA,L]RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.HTML brand\.PHP\?ID=$1&cat=$2&page=$3&sort=$4&order=$5 [QSA,L]RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.HTML brand\.PHP\?ID=$1&cat=$2&page=$3 [QSA,L]RewriteRule ^brand-([0-9]+)-c([0-9]+)(.*)\.HTML brand\.PHP\?ID=$1&cat=$2 [QSA,L]RewriteRule ^brand-([0-9]+)(.*)\.HTML brand\.PHP\?ID=$1 [QSA,L]RewriteRule ^tag-(.*)\.HTML search\.PHP\?keywords=$1 [QSA,L]RewriteRule ^snatch-([0-9]+)\.HTML$ snatch\.PHP\?ID=$1 [QSA,L]RewriteRule ^group_buy-([0-9]+)\.HTML$ group_buy\.PHP\?act=vIEw&ID=$1 [QSA,L]RewriteRule ^auction-([0-9]+)\.HTML$ auction\.PHP\?act=vIEw&ID=$1 [QSA,L]

RewriteEngine OnRewriteRule ^(.*)/ivIDeo(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.HTML$ /ivIDeo.PHP?tv=&ti=&tc=&page=RewriteRule ^(.*)/ispecial(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.HTML$ /ispecial.PHP?tv=&ti=&tc=&page=RewriteRule ^(.*)/icategory\.HTML$ /icategory.PHPRewriteRule ^(.*)/category-cID-([0-9]+)(-tag-([^-]*))?(-timelimit-([0-9]+))?(-orderlimit-([0-9]+))?(-page-([0-9]+))?\.HTML$ /category.PHP?cID=&tag=&timelimit=&orderlimit=&page=RewriteRule ^(.*)/vspace-(mID|username)-(.+)\.HTML$ /vspace.PHP?=RewriteRule ^(.*)/vIDeo-(vID|ivID)-(.+)\.HTML$ /vIDeo.PHP?=RewriteRule ^(.*)/special-spID-([0-9]+)\.HTML$ /special.PHP?spID=

# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 /SupeV 为你的播客目录地址,如果程序放在根目录中,请将 /SupeV 修改为 /RewriteBase /SupeV# Rewrite 系统规则请勿修改 RewriteRuleRewriteRule ^ivIDeo(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.HTML$ ivIDeo.PHP?tv=$2&ti=$4&tc=$6&page=$8RewriteRule ^ispecial(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.HTML$ ispecial.PHP?tv=$2&ti=$4&tc=$6&page=$8RewriteRule ^icategory\.HTML$ icategory.PHPRewriteRule ^category-cID-([0-9]+)(-tag-([^-]*))?(-timelimit-([0-9]+))?(-orderlimit-([0-9]+))?(-page-([0-9]+))?\.HTML$ category.PHP?cID=$1&tag=$3&timelimit=$5&orderlimit=$7&page=$9RewriteRule ^vspace-(mID|username)-(.+)\.HTML$ vspace.PHP?$1=$2RewriteRule ^vIDeo-(vID|ivID)-(.+)\.HTML$ vIDeo.PHP?$1=$2RewriteRule ^special-spID-([0-9]+)\.HTML$ special.PHP?spID=$1

RewriteEngine On RewriteRule ^/(space|network)\-(.+)\.HTML$ /$1.PHP?Rewrite=$2 [L] RewriteRule ^/(space|network)\.HTML$ /$1.PHP [L] RewriteRule ^/([0-9]+)$ /space.PHP?uID=$1 [L]

RewriteEngine On RewriteBase / RewriteRule ^(space|network)\-(.+)\.HTML$ $1.PHP?Rewrite=$2 [L] RewriteRule ^(space|network)\.HTML$ $1.PHP [L] RewriteRule ^([0-9]+)$ space.PHP?uID=$1 [L]

UCHome2.0 规则

Apache 独立主机用户:# 修改以下语句中的 /uchome 修改为你的uchome目录地址,如果程序放在根目录中,请将 /uchome 修改为 /RewriteRule ^/(space|network)-(.+)\.HTML$ /$1\.PHP\?rewrite=$2 [L]RewriteRule ^/(space|network)\.HTML$ /$1\.PHP [L]RewriteRule ^/([0-9]+)$ /space\.PHP\?uID=$1 [L]

Apache 虚拟主机用户:

 # 将 RewriteEngine 模式打开RewriteEngine OnRewriteBase /03uchomeRewriteRule ^(space|network)\-(.+)\.HTML$ $1.PHP?rewrite=$2 [L] RewriteRule ^(space|network)\.HTML$ $1.PHP [L] RewriteRule ^([0-9]+)$ space.PHP?uID=$1 [L]

转自:href="http://faq.comsenz.com/vIEwnews-12" target="_blank">http://faq.comsenz.com/vIEwnews-12

总结

以上是内存溢出为你收集整理的(康盛产品)如何在Apache环境下配置Rewrite规则全部内容,希望文章能够帮你解决(康盛产品)如何在Apache环境下配置Rewrite规则所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/1001759.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)