WordPress localhost pages redirect to live site
-
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 amReplacing URLs
withAbsolute URLs
where I am using my Github pages link. Then I putE:\...\wp-content\uploads
andE:\...\wp-content
inadditional files and directories
. Lastly, under theSettings -> Deploy
page I use myLocal Directory
and put mypath
where my wordpress directory is located for theDeployment Method
. Finally, I press theGenerate 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 theSimply Static
plugin will replace theAbsolute URL
with my github page. But is there any way to make it so when I click a link on thelocalhost
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 towordpress
andphpmyadmin
.
– In the settings menu on thewp-admin
page on wordpress, I have theWordPress Address (URL)
andSite Address (URL)
both set tohttps://localhost/mywordpress
– I am on the latest version for everything.
Thank you so much for your help!
- The topic ‘WordPress localhost pages redirect to live site’ is closed to new replies.