Emlog下二级域名绑定子目录伪静态规则


这里说的二级域名绑定子目录,是指在主域名对应空间根目录装了emlog程序的情况,并且是linux+apache环境。我们想让二级域名指向子目录实
现访问,就需要修改一下伪静态规则。首先,在你的空间管理平台中绑定二级域名(通常说接收)如:zan.mrxn.net,同时域名也要做好解析工作(一般
可以用*号泛解析), 剩下的就是配置.htaccess文件了,直接打开根目录下的.htaccess文件可以看到如下代码:

<IfModule mod_rewrite.c> RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteBase /
RewriteRule . /index.php [L] </IfModule>

现在我们以指定daohang.mrxn.net指向/daohang/目录为例修改以上代码:

<IfModule mod_rewrite.c> RewriteEngine on
RewriteCond %{HTTP_HOST} ^mrxn.net$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteBase /
RewriteRule . /index.php [L]

RewriteCond %{HTTP_HOST} ^daohang.mrxn.net$
RewriteCond %{REQUEST_URI} !^/daohang/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /daohang/$1
RewriteCond %{HTTP_HOST} ^daohang.mrxn.net$
RewriteRule ^(/)?index.php$ daohang/index.html [L] </IfModule>

手机扫码阅读

给EMLOG评论框加上√防止垃圾评论

给Emlog添加页面加载(加载中)特效

评 论