Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 2nd July 2014, 19:11
doekia doekia is offline
Junior Member
 
Join Date: Mar 2012
Posts: 28
Thanks: 2
Thanked 9 Times in 8 Posts
Default SEO redirect on alias apparently wrong...

Hi,

I got the strange feeling that something is wrong with the SEO redirect option on site alias.

USE CASES:

Site: a-domain.com (auto www.)
Alias: b-domain.com (auto www. + SEO: * => www.domain.tld )
Quote:
ServerName a-domain.com
ServerAlias www.a-domain.com
ServerAlias www.b-domain.com b-domain.com

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.b-domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.b-domain.com$1 [R=301,L]
Expected Rewrite directing to be a-domain.com
---
Site: a-domain.com (auto www.)
Alias: b-domain.com (auto www. + SEO: *.domain.tld => www.domain.tld )
Quote:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(b-domain\.com|((?:\w+(?:-\w+)*\.)*)((?!www\.)\w+(?:-\w+)*)(\.b-domain\.com))$ [NC]
RewriteRule ^(.*)$ http://www.b-domain.com$1 [R=301,L]
Sound a bit over-complex imho, and again expecting www.a-domain.com as redirection target
---

I also tend to think that there is a missing SEO option as:
*.domain.tld => *.domain.tld
With rule such as:
RewriteCond %{HTTP_HOST} ^(.*)\.b-domain\.com$ [NC]
RewriteRule ^(.*)$ http://%1.a-domain.com$1 [R=301,L]


If anyone face similar issue a quick fix consists in implementing no SEO redirect thru the alias form and implement the RewriteRule in the apache directive for the site.

Best,
Reply With Quote
The Following User Says Thank You to doekia For This Useful Post:
robertoshulze2257 (10th July 2014)
Sponsored Links
  #2  
Old 2nd July 2014, 19:34
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,787
Thanks: 821
Thanked 5,337 Times in 4,187 Posts
Default

Both seo redirects are exactly as theyare intended. A redirect from the subdomain to the added alias domain, the redirect shall not go to the main domain of the website like you claimed above as the alias domain function is mostly used for multidomain cms systems, so the redirect rule may not change the domain name or the cms will fail.

The redirect that you requested above is not the redirect of the seo redirect function, what you requested is the normal redirect which offers also a 301 redirect option were you can set the target domain in the redirect target field.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 3rd July 2014, 10:11
doekia doekia is offline
Junior Member
 
Join Date: Mar 2012
Posts: 28
Thanks: 2
Thanked 9 Times in 8 Posts
Default

Quote:
Originally Posted by till View Post
the alias domain function is mostly used for multidomain cms systems, so the redirect rule may not change the domain name or the cms will fail
I certainly missed the point here. In my mind a multi-domain cms system is domain aware hence no need to redirect up-front. The CMS route/dispatcher does so ... at least for those CMS I know

Quote:
Originally Posted by till View Post
The redirect that you requested above is not the redirect of the seo redirect function, what you requested is the normal redirect which offers also a 301 redirect option were you can set the target domain in the redirect target field.
Yes the alias to redirect to the main domain
like domain.de , domain.fr, domain.co.uk been SEO redirected - ie: no duplicate content seen - to domain.com


On the solution you propose (normal redirect), there is also an issue (I guess):
Web Aliasdomain
Aliasdomain: b-domain.com
Parent Website: a-domain.com
Redirect Type: R=301,L
Redirect Path: http://www.a-domain.com
Auto-Subdomain: www.
SEO Redirect: none
Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^b-domain\.com$ [NC]
RewriteRule ^/(.*)$ http://www.a-domain.com [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.b-domain\.com$ [NC]
RewriteRule ^/(.*)$ http://www.a-domain.com [R=301,L]
This does not redirect http://www.b-domain.com (no / in the url)
This does not redirect http://www.b-domain.com/a-url to http://www.a-domain.com/a-url ( captured match not visible )
If we try to *trick* set the redirect path to http://www.a-domain.com/$1,
ERROR Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/
(safe error I think)


I think that the SEO to parent is something missing. I use it a lot on various sites/CMS/eCommerce. Been easily settable from client panel be a nice addition.
Reply With Quote
The Following 2 Users Say Thank You to doekia For This Useful Post:
robertoshulze2257 (15th July 2014), Williamsl (8th July 2014)
  #4  
Old 3rd July 2014, 11:47
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,787
Thanks: 821
Thanked 5,337 Times in 4,187 Posts
 
Default

I think we should add a option so that the seo redirect can either redirect to the alias domain or to the main domain.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
doekia (3rd July 2014)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix delivery problem erebus Installation/Configuration 8 29th July 2014 20:17
CGI variable SERVER_NAME lacks the www prefix despite auto-subdomain and SEO redirect cbj4074 Installation/Configuration 7 10th July 2013 16:01
Redirect an alias domain to a php script Zerogiven Installation/Configuration 1 8th May 2013 15:03
post fix error after a year aberrio Server Operation 5 5th May 2009 21:33
Installation Troubles bswinnerton Installation/Configuration 4 29th July 2007 16:56


All times are GMT +2. The time now is 13:53.


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