• holacaracola

    (@holacaracola)


    Hi,

    After moving my site from a top domain: https://xyz.com
    to a subdomain “efg” under a different top domain “abc”: https://abc.com/efg
    the links on the Index/Front page (only the Index/Front page!) are not working.
    The Index (Front) page links are incorrectly generated. They are generated relative to the top domain (abc.com/mypage) and not to its subdomain (abc.com/efg/mypage), as they should.

    My old site was working perfectly (before I moved it).
    The Index page itself works well (apart from its links).
    The menu is working fine as well as all other pages

    I am using relative links in the whole site (and when it’s finished I will move it again, so I try to avoid static/direct links).

    I.e. page “info” should be linked to: https://abc.com/efg/info
    and all pages including the menu do that, but NOT the index page.
    The Index page will generate this link: https://abc.com/info
    which of course doesn’t work.

    This is how I create my relative links:
    To link to page 123 I use: ../page123
    To link to image “orange.jpg” in folder “images”: ../images/organge.jpg
    It worked before I move the site, and now it works on all pages but the Index page.

    WordPress Adress (URL): abc.com/efg
    Site Address (URL): abc.com/efg
    Permalinks Postname: https://abc.com/efg/sample-post/

    Permanlink on the Index (Front) page: https://abc.com/efg

    .htaccess

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

    Any help is much appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter holacaracola

    (@holacaracola)

    I would like to add that (after the move to a subdomain) relative links actually DO work on the Index page, BUT I have to write them differently.
    I mean, on any other page but the Index page, the relative links are written like this:
    ../images/organge.jpg

    But on the Index page, I need to enter a relative link like this:
    images/organge.jpg

    I didn’t have to do that when the site was placed in a top domain.

    The problem is that when I write it like this:
    images/organge.jpg
    it only works on the Index page.

    And when I write it like this:
    ../images/organge.jpg
    it only works on all pages but the Index page.

    I could have lived with that, but it is really causing me big trouble, as the header and the footer are used and identical all pages, so I can either make the links in the header/foot work on the Index page, or on all of the other pages.

    The menu is working on all pages though, but I don’t specify relative links in the menu, I just point of the pages so I get the WordPress framework figures it out correctly there.

Viewing 1 replies (of 1 total)
  • The topic ‘Links on Index page doens’t work after move’ is closed to new replies.