WordPress.org

Ready to get started?Download WordPress

Forums

sub-folder installation URL auto-redirects to wrong domain (1 post)

  1. marcogodles
    Member
    Posted 2 years ago #

    Hey everyone!

    I have 2 different websites set up on my FTP server. My first website is in my root directory with the domain address http://www.work-domain.com. I have a second domain address http://www.personal-domain.com that is linked to a sub-folder of the same FTP server root/personal/. WordPress is installed in the 'personal' sub-folder.

    In the root directory, the .htaccess file has:

    RewriteCond %{HTTP_HOST} ^(www\.)?personal-domain.com/?$
    RewriteRule ^(.*)$ http://www\.work-domain.com/personal/$1 [QSA,L,P]

    This correctly directs http://www.personal-domain.com to the sub-folder as the root and works fine.

    In the sub-folder, the .htaccess file has:

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

    This now makes my permalinks work correctly.

    The problem i am having is that when i click any link, say for example the 'about' page, the domain address re-directs to http://www.work-domain.com/personal/about instead of http://www.personal-domain.com/about.

    i tried changing the site URL and wordpress URL from http://www.work-domain.com/personal to http://www.personal-domain.com. this works, but then screws up my permalinks.

    im afraid ive hit a wall and not sure what to do next...
    Any help on this matter would be be great!

    thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic