WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Local Pages Don't Load - XAMPP (14 posts)

  1. CiderJack
    Member
    Posted 1 year ago #

    The already existing website has been migrated off the host server to work on it locally.

    The problem is when viewing the main site, only the Home page or Search Results page will load. Clicking links to any local pages (other than those two) will load the XAMPP default page (http://localhost/xampp/). The link URLs all appear to be correct, they just don't go where they should.

    On the other hand, can login and navigate the admin pages without any problems - everything there looks like it's where it should be.

    Scratching my head on this one! Setup:
    WP 3.5.1
    XAMPP 1.8.1
    Windows 7

  2. CiderJack
    Member
    Posted 1 year ago #

    UPDATE
    Just noticed when hovering over the 'Home' url, it has an extra slash: 'http://localhost/htdocs/wordpress//'. Not sure what that's doing there, none of the (nonworking) links have that. When clicking that link, it loads the Home page but the URL in the address bar displays correctly, with only one trailing slash. Not sure if this is related

  3. ClaytonJames
    Member
    Posted 1 year ago #

    The addresses should be http://localhost/wordpress. "htdocs" should not appear in the path.

  4. CiderJack
    Member
    Posted 1 year ago #

    Actually, my (somewhat clumsy) file structure does include a second 'htdocs' folder, because an extra folder depth was needed to keep files related to that website organized. The file resides at
    F:/xampp/htdocs/htdocs/wordpress
    which in the browser displays as
    http://localhost/htdocs/wordpress

    So the homepage loads with that url, but hovering over the 'Home' menu link displays with a double slash // at the end. Not sure if that's related to the main issue of other pages/articles being redirected to the default xampp page. Their urls display correctly when hovering over the links.

    I can navigate the http://localhost/htdocs/wordpress/wp-admin/ pages without any trouble, and the 'view post' button will correctly display the page. It's the menu links (or even typing the url directly) that redirect to xampp page, even though the urls are correct.

  5. ClaytonJames
    Member
    Posted 1 year ago #

    That's odd. WordPress will usually remove any errant/unnecessary trailing slashes in your URL's in general settings.

    Does anything different happen if you change permalink structure and/or update .htaccess? Have you updated .htaccess yet since you imported the live site to the local environment?

  6. CiderJack
    Member
    Posted 1 year ago #

    Noticed the html source showed the extra slash, and found this line in header.php
    <a href="<?php echo home_url( '/' ); ?>" rel="home">
    Deleting the '/' had no effect, the home page link still shows with double // at the end. Even commenting out the whole anchor tag didn't seem to affect the navigation. However, the double slash issue isn't my main concern since as you say wordpress removes the extra / when clicking the link, so that actually works as it is (even if it's only by a courtesy hack via WP). Just thought it might be related.

    But AH! Deleting the text from .htaccess and then changing perma links to default and back again solved it! Marking this resolved. Thanks Clayton! I never would have figured that. :)

  7. ClaytonJames
    Member
    Posted 1 year ago #

    Nice! Glad that did the trick.

  8. corienb
    Member
    Posted 1 year ago #

    Thanks! Permalinks back to default (and then back again if you want to, but default works and for testing purposes I really don't care) fixed it for me too.

    Live site transferred to XAMPP succesfully :)
    (export live database, import into XAMPP database, edit database wp_options table so site url and home are on localhost/foldername/)

  9. AmyZealand
    Member
    Posted 12 months ago #

    Thank you so much for detailed solution!! This fixed the problem for me too.

  10. mfrealdo
    Member
    Posted 11 months ago #

    This means that once you work local you are not able to set Permalinks to "post name".
    It works if them are set back to default, but what happens when we need to come back on line? Can we switch Permalinks back to "post name"?

    Sorry, I'm a newbie

    Ciao

  11. kt12385
    Member
    Posted 10 months ago #

    clicking on the label of a page on my local host is redirecting to the xampp page....Anyone please help me how to resolve this error

  12. kt12385
    Member
    Posted 10 months ago #

    all the pages have been added to the menus and the code in the respective pages seems perfectly fine but not able to understand why clicking the label is not redirecting to the respective content

  13. naresh.manthena
    Member
    Posted 9 months ago #

    The already existing website has been migrated off the host server to work on it locally.

    The problem is when viewing the main site, only the Home page or Search Results page will load. Clicking links to any local pages (other than those two) will load the XAMPP default page (http://localhost/xampp/). The link URLs all appear to be correct, they just don't go where they should.

    On the other hand, can login and navigate the admin pages without any problems - everything there looks like it's where it should be.

    When I changed the permalinks into default then its wokring but the liks should come with Post name

  14. esmi
    Forum Moderator
    Posted 9 months ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags