网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Discuz/SupeSite/X-Space
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Discuz/SupeSite/X-Space 讨论Discuz安装、升级、模板、插件、源代码修改以及使用技巧等。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 218.2.39.80
Old 2007-02-23, 11:58 AM
car car is offline
高级会员
 
Join Date: 2006-05-14
Posts: 534
car 正向着好的方向发展
Default SupSite/X-Space 启用Rewrite说明

SupSite/X-Space 启用Rewrite说明
------------------------------
http://www.supesite.com
http://X-Space.discuz.net

===============================================
+ Apache Web Server(虚拟主机用户)
===============================================


在开始以下设置之前,请首先咨询您的空间服务商
空间是否支持 Rewrite 以及是否支持对站点目录中 .htaccess 的文件解析
否则即便按照下面的方法设置好了,也无法使用

注意:

以下规则,仅适用于程序可以通过独立域名或者二级域名直接访问。
如果您的程序需要域名后面加目录名的方式才可以访问,那么,您需要手工修改以下规则:

将 “RewriteBase /” 修改为 “RewriteBase /xxx”

其中,“xxx” 为您的程序目录名


-----------------------------------------------------------------------

RewriteEngine On
RewriteBase /
RewriteRule ^([0-9]+)/spacelist_(.*)$ index.php?$1/action_spacelist_$2
RewriteRule ^([0-9]+)/viewspace_(.+)$ index.php?$1/action_viewspace_itemid_$2
RewriteRule ^([0-9]+)/viewbbs_(.+)$ index.php?$1/action_viewbbs_tid_$2
RewriteRule ^([0-9]+)/(.*)$ index.php?$1/$2
RewriteRule ^([0-9]+)$ index.php?$1
RewriteRule ^action_(.+)$ index.php?action_$1
RewriteRule ^category_(.+)$ index.php?action_category_catid_$1
RewriteRule ^itemlist_(.+)$ index.php?action_itemlist_catid_$1
RewriteRule ^viewnews_(.+)$ index.php?action_viewnews_itemid_$1
RewriteRule ^viewthread_(.+)$ index.php?action_viewthread_tid_$1
RewriteRule ^index([\.a-zA-Z0-9]*)$ index.php

-----------------------------------------------------------------------

添加内容时,请遵照上面的提示,修改程序所在的路径
然后保存为文件 .htaccess 。将 .htaccess 文件上传到SupeSite所在的目录中
进入SupeSite 系统设置,根据需要开启 URL 静态化 功能


===============================================
+ Apache Web Server(独立主机用户)
===============================================


首先确定您使用的 Apache 版本,及是否加载了 mod_rewrite 模块。
Apache 1.x 的用户请检查 conf/httpd.conf 中是否存在如下两段代码:
LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c
Apache 2.x 的用户请检查 conf/httpd.conf 中是否存在如下一段代码:
LoadModule rewrite_module modules/mod_rewrite.so
如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代码
此时请务必注意,如果网站使用通过虚拟主机来定义
请务必加到虚拟主机配置,即 <VirtualHost> 中去,如果加在虚拟主机配置外部将可能无法使用
改好后然后将 Apache 重启。

注意:

以下规则,仅适用于程序可以通过独立域名或者二级域名直接访问。
如果您的程序需要域名后面加目录名的方式才可以访问,那么,您需要手工修改以下规则:

将 “^/” 修改为 “^/xxx/”
将 “/index.php” 修改为 “/xxx/index.php”

其中,xxx 为您的程序目录名

-----------------------------------------------------------------------

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/([0-9]+)/spacelist_(.*)$ /index.php?$1/action_spacelist_$2
RewriteRule ^/([0-9]+)/viewspace_(.+)$ /index.php?$1/action_viewspace_itemid_$2
RewriteRule ^/([0-9]+)/viewbbs_(.+)$ /index.php?$1/action_viewbbs_tid_$2
RewriteRule ^/([0-9]+)/(.*)$ /index.php?$1/$2
RewriteRule ^/([0-9]+)$ /index.php?$1
RewriteRule ^/action_(.+)$ /index.php?action_$1
RewriteRule ^/category_(.+)$ /index.php?action_category_catid_$1
RewriteRule ^/itemlist_(.+)$ /index.php?action_itemlist_catid_$1
RewriteRule ^/viewnews_(.+)$ /index.php?action_viewnews_itemid_$1
RewriteRule ^/viewthread_(.+)$ /index.php?action_viewthread_tid_$1
RewriteRule ^/index([\.a-zA-Z0-9]*)$ /index.php
</IfModule>

-----------------------------------------------------------------------

如果没有安装 mod_rewrite,您可以重新编译 Apache
并在原有 configure 的内容中加入 --enable-rewrite=shared
然后再在 Apache 配置文件中加入上述代码即可。

进入SupeSite 系统设置,根据需要开启 URL 静态化 功能


===============================================
+ IIS服务器(Windows主机用户)
===============================================


首先,需要安装模块

安装方法是:将iisrewrite.zip中的文件解压到服务器的一个目录中。
打开IIS管理器 -> 选择网站属性 -> ISAPI筛选器 -> 在名称中输入rewrite ->
可执行文件选择刚才解压后的文件Rewrite.dll -> 点确定
-> 再点确定 -> 关闭属性对话框
再次查看网站属性 -> 到ISAPI筛选器
如果看到状态为向上的绿色箭头,就说明Rewrite模块安装成功了

然后,修改Rewrite规则

到刚才解压的目录下,找到httpd.ini文件
httpd.ini的规则,仅适用于程序可以通过独立域名或者二级域名直接访问。
如果您的程序需要域名后面加目录名的方式才可以访问,那么,您需要手工修改httpd.ini的规则:

将 “^/” 修改为 “^/xxx/”
将 “/index\.php” 修改为 “/xxx/index\.php”
其中,xxx 为您的程序目录名


一旦修改了Rewrite规则,请重启网站,使规则生效
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:08 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.