mod rewrite is not affected for domain without www?
i have this setting for apache :
<VirtualHost mysite.co.id:80>
ServerAdmin admin@mysite.co.id
DocumentRoot /var/www/html/main
ServerName mysite.co.id
ErrorLog logs/mysite.co.id.error
CustomLog logs/mysite.co.id.access common
<Directory "/var/www/html/main/">
Options +Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteRule ^/sub1(.*) http://sub1.mysite.co.id$1 [NC,R,L]
</VirtualHost>
<VirtualHost beta.mysite.co.id:80>
ServerAdmin admin@beta.mysite.co.id
DocumentRoot /var/www/html/beta
ServerName beta.mysite.co.id
ErrorLog logs/beta.mysite.co.id.error
CustomLog logs/beta.mysite.co.id.access common
<Directory "/var/www/html/beta/">
Options +Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteRule ^/sub1(.*) http://sub1.beta.mysite.co.id$1 [NC,R,L]
</VirtualHost>
<VirtualHost www.mysite.co.id:80>
ServerAdmin admin@www.mysite.co.id
DocumentRoot /var/www/html/main
ServerName www.mysite.co.id
ErrorLog logs/www.mysite.co.id.error
CustomLog logs/www.mysite.co.id.access common
<Directory "/var/www/html/main/">
Options +Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteRule ^/sub1(.*) http://sub1.www.mysite.co.id$1 [NC,R,L]
</VirtualHost>
this condition will redirect for all sub1 folder accessed will be redirect
to our new subdomain sub1.
all work for beta.mysite.co.id and www.mysite.co.id but failed for
mysite.co.id
what i miss from here? i have check my /var/log/mysite.co.id but only my
php error listed there and it's one month ago :
[Mon Sep 02 10:28:10 2013] [error] [client 128.21.30.30] File does not
exist: /v
ar/www/html/favicon.ico
[Mon Sep 02 10:29:10 2013] [error] [client 128.21.30.30] Directory index
forbidd
en by Options directive: /var/www/html/
[Mon Sep 02 10:29:29 2013] [error] [client 128.21.30.30] File does not
exist: /v
ar/www/html/mysite
[Mon Sep 02 10:29:34 2013] [error] [client 128.21.30.30] Directory index
forbidd
en by Options directive: /var/www/html/
[Mon Sep 02 10:30:15 2013] [error] [client 128.21.30.30] Directory index
forbidd
en by Options directive: /var/www/html/
my system :
PHP Version 5.3.3
Apache/2.2.15 (CentOS)
Linux my.centos 2.6.32-358.18.1.el6.x86_64
update:
everything changing line inside mysite.co.id will not affected the page,
but i ping all mysite.co.id, www.mysite.co.id and beta.mysite.co.id will
refer to the same IP
No comments:
Post a Comment