PDA

View Full Version : Redirect Help (httaccess)


Pirat3
03-14-2008, 02:47 AM
Hi, I have a linux server and have run into a issue.

I host 2 websites off of 1 server.

I did a 301 redirect in the .httacess file on each domain to have it redirct to the www. domain.

For example when a user goes to:
site1.com it would redirect them to www.site1.com

However my second domain it does not work this way, when I go to
site2.com it redirects me to www.site1.com

How can I get my second domain to redirect me to www.site 2.com?

Here is part of my httacess file that deals with redirect for 1 domain, both are same , except where the domain name goes is changed to reflect the domain :P
Code:

RewriteCond %{HTTP_HOST} !^www\.site1\.com
RewriteRule (.*) http://www.site1.com/$1 [L,R=301]

Thanks in advanced

Clarify:
They are in diffrent dircetories.

Site 1 is in /root/home/site1/public_html/
site 2 is in /root/home/site2/public_html/

each site has its own htttpaccess, so which one do I edit or do I have this all setup wrong?

SEOvB
03-14-2008, 04:56 AM
post your .htaccess for both domains.

Pirat3
03-15-2008, 05:12 AM
Here, I use VBSeo btw

php_value upload_max_filesize 30M
php_value post_max_size 30M

#RewriteEngine On
#RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /

#RewriteCond %{HTTP_HOST} !^www\.SITE1\.net
#RewriteRule (.*) http://www.SITE1.net/$1 [L,R=301]

RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*\.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]



The other httacees is exactly same excet site1=site2

game.over
03-15-2008, 07:20 AM
Here, I use VBSeo btw




The other httacees is exactly same excet site1=site2

Hey,

why you do not make a request to VBSEO support?

Best regards

ssslippy
03-15-2008, 01:11 PM
Ill note this u have the line commented.

Pirat3
03-15-2008, 02:23 PM
Ill note this u have the line commented.

yes i know i just did that for testing because the domains were acting all funky and they still are even after i commented it out.

for somereason site2.com still goes to www.site1.com even tho changes are gone.

is there some file in ROOT that maybe causing this issue?

ssslippy
03-18-2008, 01:42 AM
Have you checked the config files for your different sites inside apache? Is it possible u put in the wrong folder location on the server.