PDA

View Full Version : Additional Domains


pashaweb
2-26-02, 10:52 AM
I have a question:

Lets say I have 2 domain names:

domain1.com - main domain
domain2.com - additional parked domain

Currently domain2.com (additional domain) points to the same location as domain1.com. How can I associate domain2.com to a sub folder so that when people go to domain2.com they'd see contents from htdocs/sub-domain2

I don't for people to see that they are being redirected to a sub-domain, I want them to think that they are visiting totally separate site - www.domain2.com

Will this trick work?

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !sub-domain2/
RewriteRule ^(.*)$ sub/$1 [L]

VBman
2-26-02, 11:17 AM
It should work fine. There is a tutorial that will walk you thru the process here:
http://powhelp.mywebthing.com/viewtopic.php?t=17

pashaweb
2-26-02, 11:32 AM
Yes you are right, it does work BUT:

Now both of my domains - main and additional won't show IMAGES. Any ideas why? Do I need to add my main domain to the .htaccess file as well?

VBman
2-26-02, 11:35 AM
Originally posted by pashaweb
Now both of my domains - main and additional won't show IMAGES. Any ideas why? Do I need to add my main domain to the .htaccess file as well?

I don't think you need to add your main domain to the .htaccess file. I don't have to add it to mine, but it couldn't hurt to try it.

pashaweb
2-26-02, 12:02 PM
Thanks but it didn't work, have no idea what's the problem is...

When I add the following:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} domain2.com
RewriteCond %{REQUEST_URI} !sub-domain2/
RewriteRule ^(.*)$ sub-domain2/$1 [L]

Everything works perfectly except that none of my images, includes etc would work at domain.com and domain2.com

When I change image paths of domain2.com from:
images/image_here.gif
to
/sub-domain2/images/image_here.gif
it works fine and I have no problems with doing so, but images of my domain.com won't show at all :) even if I change path from image/file.gif to /image/file.gif

Whatta hell..? Why would my domain.com be effected if it's not even in .htaccess file...

pashaweb
2-26-02, 12:21 PM
Here is the error:

Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden

MannInc
2-27-02, 11:52 AM
if you are using 2 domains under the same package and the second is in a subfolder and not showing the same site as the first, do the following:

1st Site
---------

Create a folder under the htdocs called images. Move all site wide image here and update the image references in your site to point to this directory

2nd Site
----------

Create a folder under the sub folder (placed under the htdocs)called images. Move all site wide image here and update the image references in your site to point to this directory.

This solution should clear up any image problems you have.