Forum Moderators: phranque

Message Too Old, No Replies

Two domains one hosting

but cant load images in to the second domain

         

Omegacool

7:18 am on Oct 30, 2007 (gmt 0)

10+ Year Member



Hello, greetings to all, I am new to the forum and not write well in English

I have two domains, dom1 and dom2 and only hosting. Dom1 is directed toward the root / and dom2 going to a folder /ecosa

I have a htaccess file in the root:

# DOM1
Options FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^dom1.com [NC]
RewriteRule ^(.*) [dom1.com...] [L,R=301]

# BEGIN WordPress for pretty permalinks

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteCond %{HTTP_HOST} ^www.dom2.com.*
RewriteCond %{REQUEST_URI}!/ecosa
RewriteRule ^(.*) [dom2.com...]
RewriteCond %{HTTP_HOST} ^dom2.*
RewriteCond %{REQUEST_URI}!/dom2
RewriteRule ^(.*) [dom2.com...]

and a htacces in to the folder /ecosa

# DOM2
Options FollowSymLinks

RewriteEngine On

RewriteBase /

# esto va en la carpeta
RewriteCond %{HTTP_HOST}!^www\.dom2\.com [NC]
RewriteRule ^(.*) [dom2.com...] [L,R=301]

# BEGIN WordPress for pretty permalinks

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I do not have any problem in working with dom1 but in trying to use uploaded pictures of dom2 seems blocked because they are not viewed achievement in any way. What you get is 404

I may help solve this problem?

Thanks for your help

jdMorgan

1:13 pm on Oct 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would suggest starting with the following changes and optimizations:

# DOM1 and DOM2 in top-level .htaccess file
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#
# Externally redirect dom1.com to www.dom1.com
RewriteCond %{HTTP_HOST} ^dom1\.com [NC]
RewriteRule (.*) http://www.dom1.com/$1 [L,R=301]
#
# Externally redirect dom2 to www.dom2.com
RewriteCond %{HTTP_HOST} ^dom2\. [NC]
RewriteRule (.*) http://www.dom2.com/$1 [L,R=301]
#
# Internally rewrite dom2 to subdirectory /ecosa
RewriteCond %{HTTP_HOST} ^www\.dom2\.
RewriteCond %{REQUEST_URI} !/ecosa
RewriteRule (.*) /ecosa/$1 [L]
#
# BEGIN WordPress for pretty permalinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

.htaccess in to the folder /ecosa

# DOM2
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#
# BEGIN WordPress for pretty permalinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ecosa/index.php [L]
# END WordPress

Jim

Omegacool

1:36 am on Oct 31, 2007 (gmt 0)

10+ Year Member




Thank you, it has worked perfectly.The images and the links operate at perfection

g1smd

1:42 am on Oct 31, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is a good thread to be bookmarked.