• Resolved jasonmatthew07

    (@jasonmatthew07)


    Hi, I am trying to create a simple website using wordpress that I can host on Github Pages.

    On the Simply Static plugin page, I have it set up under the Settings -> General that I am Replacing URLs with Absolute URLs where I am using my Github pages link. Then I put E:\...\wp-content\uploads and E:\...\wp-contentin additional files and directories. Lastly, under the Settings -> Deploy page I use my Local Directory and put my path where my wordpress directory is located for the Deployment Method. Finally, I press the Generate Static Files button, it compiles, I push it to my repository, and the github pages website works correctly!

    However, my issue is after my Github pages is updated, when I go back to my wordpress site on localhost, if I click on a link in the header to go to a different page, it will redirect it to the live site for that page (located on github pages). The weird thing is, when I went to inspect the html for the home page, the link says <a href=https://localhost/my-site>, but when I click on the link in the header and the new page loads, it changes the <a href> in the header to <a href=https://myid.github.io/...>.

    I think I understand why this is doing this, since the Simply Static plugin will replace the Absolute URL with my github page. But is there any way to make it so when I click a link on the localhost it won’t redirect to the live github site?

    Some information that may be important about my wordpress app:
    – Plugins: Simply Static, Spectra, Starter Templates
    – Theme: Astra
    – I am using XAMPP to host my site locally (which gives me access to wordpress and phpmyadmin.
    – In the settings menu on the wp-admin page on wordpress, I have the WordPress Address (URL) and Site Address (URL) both set to https://localhost/mywordpress
    – I am on the latest version for everything.

    Thank you so much for your help!

Viewing 1 replies (of 1 total)
  • Plugin Author patrickposner

    (@patrickposner)

    Hey @jasonmatthew07,

    thanks for the report.

    There are a couple of issues here.

    Local Development:

    You might want to start by reading the following docs article here: https://simplystatic.com/docs/problems-with-local-development/

    SSL:

    You absolutely need an SSL certificate on your local installation, and you should use a plugin like “Better Search and Replace” to replace all instances of “HTTP” with “HTTPS.”

    You should also see the warning in Simply Static -> Settings -> Diagnostics.

    General Recommendation:

    Make sure to activate “Force URL Replacements” in Simply Static -> Settings -> General -> Replace URLs.

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress localhost pages redirect to live site’ is closed to new replies.