HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   General (
-   -   www redirect? (

commentator 10th August 2008 12:30

www redirect?

I added a domain

I want to redirect and to I setup the redirect and is working. shows me the default welcomepage (no index.html)

how to fix the www to redirect also?

till 11th August 2008 11:15

add as co-domain to the website

commentator 11th August 2008 17:40

well if was on my server it was no problem. It is hosted somewhere else.

falko 12th August 2008 20:14

Canyou post the vhost configuration of that vhost from Vhosts_ispconfig.conf?

commentator 12th August 2008 20:40


<VirtualHost <myip>:80>
DocumentRoot /var/www/web16/web
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.jsp Default.htm default.htm
ErrorLog /var/www/web16/log/error.log
Alias /error/ "/var/www/web16/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web16/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web16/user/$1/web/$3
RewriteEngine on
RewriteCond %{HTTP_HOST}  ^domain2\.com [NC]
RewriteRule ^/(.*)$1 [L,R]
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule .* - [F]

I also tried adding a co-domain for host "www" but then I get an error something like "already in use"

falko 13th August 2008 17:58

Put this in the Apache Directives field in ISPConfig:


RewriteEngine on
RewriteCond %{HTTP_HOST}  ^www\.domain2\.com [NC]
RewriteRule ^/(.*)$1 [L,R]

commentator 13th August 2008 22:07

thanks, thats working

why is it not working by default if I setup a redirect for a domain?

till 13th August 2008 22:12

It is working fine when you use the default redirect. The only difference is that the domain changes when you use the default redirect function and if you use the rule that falko posted above, the domain in the browser bar dioes not change to the target domain.

All times are GMT +2. The time now is 16:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.