Forum Moderators: phranque
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
# 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
# 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