Support » Fixing WordPress » URL dropping subdirectory when entering from certain pages

  • When I click one of the menu options on the left hand column of the store page or enter the store from an individual product linked to from a blog post, every subsequent category or product in the store results in a URL that is missing the /store/ subdirectory. This means that when I copy the URL from the address bar and use it as a hyperlink or send it to someone, when they click that link, it takes them to an error page on my site. If I use the store option from the top menu on my site, all the links render correctly and I don’t have this issue. I have spent hours trying to change settings and figure out what is causing this discrepancy. Does anyone have any ideas as to why using the left menu (which is hard-coded with a custom url option) to enter the store would result in URLs dropping the /store/ subdirectory? Any suggestions would be greatly appreciated!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    There’s something wrong with the product links generated on category templates. I followed the music book link from the left menu, which still has the /store/ in the link, but all the products listed lack /store/ in their links. I see what you mean though, following the same music book link from the store page results in product links that include /store/.

    How are product links generated on category templates? The links in the page source are relative, as in <a href="/Music-Manuscript-Book-p43143381">. Relative links in WP are bad news for exactly this reason. All links should be absolute, including domain and path. Full paths should be output when the_permalink() is used, for example <a href="<?php the_permalink(); ?>">, which should result in a link like httр://

Viewing 1 replies (of 1 total)
  • The topic ‘URL dropping subdirectory when entering from certain pages’ is closed to new replies.