扭扭丹丹 发表于 2017-3-13 11:05:30

伪静态 二级目录怎么编写

网站在根目录的话是正常的。
但是我放在二级目录   zx/ 里面
但是访问www.xxx.com/zx 总是跳到根目录的网址。
如果把.htaccess 删除 就提示无法访问。
应该是伪静态规则需要更改路径。 请问下如何修改。万分感谢

根目录是dz程序
/zx   二级目录是supesite程序

下面是完整原来supesite的伪静态规则。


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond % !^$
RewriteRule data/(.*).(php)$ –
RewriteRule cache/(.*).(php)$ –
RewriteRule attachments/(.*).(php)$ –
RewriteRule themes/(.*).(html)$ –

RewriteRule ^index\.html$ /index.php
RewriteRule ^top-(+)$ /index\.php\?action/channel/name/$1
RewriteRule ^qqlevel-(+).html /index\.php\?action/channel/name/qqlevel/uin/$1
RewriteRule ^qqmusic-(+).html /index\.php\?action/channel/name/qqmusic/uin/$1
RewriteRule ^friend-(+).html /index\.php\?action/channel/name/friend/uin/$1
RewriteRule ^category(.+)$ /index\.php\?action/category/catid$1
RewriteRule ^viewnews(.+)$ /index\.php\?action/viewnews/itemid$1
RewriteRule ^action(.+)$ /index\.php\?action$1
RewriteRule ^jdyl/type/(+)/(+).html /index\.php\?action/channel/name/jdyl/type/$1/id/$2
RewriteRule ^niandu/2015/$ /niandu\.php\?y2015
RewriteRule ^qqgujia-(+).html /index\.php\?action/channel/name/qqgujia/uin/$1

RewriteRule ^/(+)$ /index\.php\?uid/$1
RewriteRule ^/(+)/spacelist(.+)$ /index\.php\?uid/$1/action/spacelist/type$2
RewriteRule ^/(+)/viewspace(.+)$ /index\.php\?uid/$1/action/viewspace/itemid$2
RewriteRule ^/(+)/viewbbs(.+)$ /index\.php\?uid/$1/action/viewbbs/tid$2
#RewriteRule ^/(+)/(.*)$ /index\.php\?uid/$1/$2
#RewriteRule ^/viewthread(.+)$ /index\.php\?action/viewthread/tid$1
#RewriteRule ^/mygroup(.+)$ /index\.php\?action/mygroup/gid$1
#RewriteRule ^/play-(+)-(.+)$ /index\.php\?action/channel/name/play/uin/$1/id/$2
#RewriteRule ^/kjlevel-(+).html /index\.php\?action/channel/name/kjlevel/uin/$1
#RewriteRule ^/hzlevel-(+).html /index\.php\?action/channel/name/hzlevel/uin/$1
#RewriteRule ^/qqmood-(.+)$ /index\.php\?action/channel/name/qqmood/uin/$1
#RewriteRule ^/qqphoto-(+).html /index\.php\?action/channel/name/qqphoto/uin/$1
#RewriteRule ^/qqhot-(+).html /index\.php\?action/channel/name/qqhot/uin/$1
#RewriteRule ^/qqpet-(+).html /index\.php\?action/channel/name/qqpet/uin/$1
#RewriteRule ^/profile-(.+)$ /index\.php\?action/channel/name/profile/uin/$1
#RewriteRule ^/uplevel-(.+)$ /index\.php\?action/channel/name/uplevel/uin/$1
#RewriteRule ^/qqphoto-(+)-(.+)-(+).html /index\.php\?action/channel/name/qqphoto/uin/$1/id/$2/type/$3
#RewriteRule ^/qqphoto-(+)-(.+).html /index\.php\?action/channel/name/qqphoto/uin/$1/id/$2
#RewriteRule ^/gj(+).jpg /qqphoto/\?pid=$1

</IfModule>

呵呵和合 发表于 2017-3-13 11:05:30

:handshake:handshake:handshake:handshake:handshake

我冤我恨 发表于 2017-3-13 11:05:30

已经解决,顺便告诉下解决方法
每行伪静态规则   前面加/子目录文件名/index      如/zx/index即可

云的裁剪师 发表于 2017-3-13 11:05:30

加上目录名称即可

原来我也可以20 发表于 2017-3-13 11:05:30

加上目录名称即可

龘麤麤龘 发表于 2017-3-13 11:05:30

加上目录名称即可

白水煮人生2016 发表于 2017-3-13 11:05:30

加上目录名称即可

u_102504171 发表于 2017-3-13 11:05:30

其实你只要在后台设置好,重要的是不冲突

蓝小振 发表于 2017-3-13 11:05:30

.htaccess 放当前目录下
页: [1]
查看完整版本: 伪静态 二级目录怎么编写