Forum Moderators: phranque

Message Too Old, No Replies

domain looping error west host

looping domain

         

benevolent001

4:54 pm on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Am with virtual host , west host to be specific , i have dedicated ip but shared that with one main domain this My.com and others 4 domains

This is some old issue with west host i guess its looping the account domain , am very disturbed i just transfered my website to them

this is what am getting in my logs

Location

[My.com...]

Referrer

[My.com...]

Message

www.My.com//www.My.com/taxonomy/term/index.php/0/forum not found.

jdMorgan

5:18 pm on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That looks like a redirect or rewrite gone bad. Do you have any code in .htaccess that handles domain/hostnames in any way?

I've deployed several sites on WestHost --although they were all 'single' sites-- and haven't seen this problem.

Jim

benevolent001

5:39 pm on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This htaccess is generated by drupal and is for main account of the hosting

for which i am seeing logs

--------------------

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "(\.(engine¦inc¦install¦module¦sh¦.*sql¦theme¦tpl(\.php)?¦xtmpl)¦code-style\.pl¦Entries.*¦Repository¦Root¦Tag¦Template)$">
Order deny,allow
Deny from all
</FilesMatch>

# Set some options.
Options -Indexes
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# PHP 4, Apache 2
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# PHP 5, Apache 1 and 2
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on

# If your site can be accessed both with and without the prefix www.
# you can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
RewriteCond %{HTTP_HOST}!^www\.my\.com$ [NC]
RewriteRule .* [my.com...] [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
# RewriteCond %{HTTP_HOST}!^example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]

# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
#RewriteBase /drupal

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME}!-f
#RewriteCond %{REQUEST_FILENAME}!-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME}!-f
#RewriteCond %{REQUEST_FILENAME}!-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.73.2.2 2007/01/26 00:09:37 killes Exp $


--------------------

The folder structure and hosting of the domains is as follows

public_html
---Domain2 folder
---Add on domains

in public_html i have drupal installation for my main domain

in folder Domain2 i have drupal installation for first add on domians and its htaccess is similar to above

in folder Add on domains i have sub folders where i have two other folders and my other two domains are hosted

those two add on domains dont have htaccess files

In the folder public_html i have robots file in which i have denied access to

/domain2/
/addon domains folder/

so that when crawler comes to crawl main website it should not go to my add on domain folders

-------------------

one more thing i have noticed

If i get 404 error in any of my add on domains it redirects to my main domain

why its so?

i guess its due to

# Customized error messages.
ErrorDocument 404 /index.php

in the above htaccess but why its working for add on domains too?

-------------------

i have one dedicated ip for the hosting where all these are hosted

thanks for your time

jdMorgan

5:57 pm on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This code is screwed-up, and so is the commented-out code that follows it to do the opposite redirect.

# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule .* http://www.example.com/ [L,R=301]

The effect of this code it to redirect *any page* requested from the non-www domain to the *root* (index page) of the www- domain.

what was intended was probably:


# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule [b](.*)[/b] http://www.example.com[b]/$1[/b] [R=301,L]

One thing to try is to exclude the 'add-on' subdirectories from this redirect:

# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
RewriteCond $1 !^(addonsubdir1¦addonsubdir2¦addonsubdir3¦addonsubdir4)
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

As for your 404 problem, the local URL-path may need to be changed to include the subdirectory in which the 404 file resides. However, this problem may just be a side-effect of your main problem, so I'd leave it for later.

With the combination of unknown httpd.conf settings, bad Drupal-generated code, and unknown method of creation of "add-ons," that's all I can come up with.

Your best bet may be to contact WH and Drupal, and ask them for help.

Change all broken pipe "¦" characters in the code above to solid pipe characters before use; Posting on this forum modifies the pipe characters.

Jim