带有htaccess的动态子域的DNS错误

时间:2015-08-21 05:34:56

标签: php apache .htaccess mod-rewrite dns

我正在尝试为cityes实现dinamics子域名,但是当使用子域名时这不起作用。我的htaccess是:

Options +FollowSymlinks

<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^www.bisnet.com.co [NC]
RewriteRule ^(.*)$ http://bisnet.com.co/$1 [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^www.bisnetcolombia.com [NC]
RewriteRule ^(.*)$ http://bisnet.com.co/$1 [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} ^www.bisnet.co [NC]
RewriteRule ^(.*)$ http://bisnet.com.co/$1 [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
# Activar RewriteEngine

RewriteEngine on
RewriteBase / 
#RewriteCond %{SCRIPT_FILENAME} !-d
#RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www\.bisnet\.com\.co
RewriteCond %{HTTP_HOST} ([^.]+)\.bisnet\.com\.co
Rewriterule ^([0-9]+)\-([a-zA-Z0-9_]*)/([0-9]+)\-([a-zA-Z0-9_]*) http://bisnet.com.co/index.php?categoria=$1&empresa=$3&ciudad=%1

RewriteCond %{HTTP_HOST} !^www\.bisnet\.com\.co
RewriteCond %{HTTP_HOST} ([^.]+)\.bisnet\.com\.co
Rewriterule ^([0-9]+)\-([a-zA-Z0-9-]*) http://bisnet.com.co/index.php?categoria=$1&ciudad=%1

RewriteCond %{HTTP_HOST} !^www\.bisnet\.com\.co
RewriteCond %{HTTP_HOST} ([^.]+)\.bisnet\.com\.co
Rewriterule ^letra/([^/.]+) http://bisnet.com.co/index.php?categorias=$1&ciudad=%1

RewriteCond %{HTTP_HOST} !^www\.bisnet\.com\.co
RewriteCond %{HTTP_HOST} ([^.]+)\.bisnet\.com\.co
Rewriterule ^buscar/(.+) http://bisnet.com.co/index.php?q=$1&ciudad=%1

Rewriterule ^nosotros/(.+) http://bisnet.com.co/index.php?interna=$1

RewriteCond %{HTTP_HOST} !^www\.bisnet\.com\.co
RewriteCond %{HTTP_HOST} ([^.]+)\.bisnet\.com\.co
RewriteRule ^ http://bisnet.com.co/index.php?ciudad=%1
</IfModule>

http://htaccess.madewithlove.be/中,测试显示正常,但在我的服务器中出现错误:ERR_NAME_NOT_RESOLVED

要测试的网址是:

http://bucaramanga.bisnet.com.co/
http://bucaramanga.bisnet.com.co/letra/a
http://bucaramanga.bisnet.com.co/166-restaurantes
http://bucaramanga.bisnet.com.co/166-restaurantes/355-la_casona_del_chingo

感谢您的帮助。

0 个答案:

没有答案