当前位置: 首页 > PHP > 正文

短网址绑定二级目录的htaccess文件

绑定在二级目录url.

# .htaccess main domain to subdirectory redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^cyq.me$
# Change ‘subdirectory’ to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/url/
# Don’t change these line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change ‘subdirectory’ to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /url/$1
# Change example.com to be your main domain again.
# Change ‘subdirectory’ to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^cyq.me$
RewriteRule ^(/)?$ url/index.php [L]

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions MaxRedirects=1
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-zA-Z0-9_-]+)$ redirect.php?alias=$1 [L]
</IfModule>

本文固定链接: http://cyq.me/1302 | 陈亚玱个人博客 — 记事,关注,分享,回忆的个人博客

该日志由 cyq 于2013年02月25日发表在 PHP 分类下, 通告目前不可用,你可以至底部留下评论。
原创文章转载请注明: 短网址绑定二级目录的htaccess文件 | 陈亚玱个人博客 — 记事,关注,分享,回忆的个人博客

短网址绑定二级目录的htaccess文件:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter