Only the homepage works on a localhost version of Wordpress - php

I have installed WAMP and set up a local version of my live Wordpress site, however only the admin area and homepage work.
I have done / tried the following things, as suggested in similar questions, but the issue persists:
Changed siteurl in wp_options in phpMyAdmin to http://localhost/mysite
Changed home in wp_options in phpMyAdmin http://localhost/mysite
Updated wp-config to have the correct database login credentials
Ensure URLs in Settings - Permalinks in Wordpress begin with http://localhost/mysite
Clicked 'Save Changes' in Settings - Permalinks from the Wordpress backend
Accessed from a browser that doesn't automatically redirect to https://localhost/mysite (which Chrome was doing)
Toggled RewriteModule on in Apache Services in WAMP
Restarted all services on WAMP
Changed all instances of AllowOverride none to AllowOverride all in httpd.conf in WAMP
Restarted all services on WAMP again
Clicked 'Save Changes' in Settings - Permalins from the Wordpress backend again
On Firefox Private Browsing, any page except wp-admin/* and /mysite redirect to https://localhost, which gives an error message.
I have managed to stop the redirect to HTTPS, but the pages still don't work. In this case I'm presented with a butchered version of the localhost homepage.
Any advice on getting this sorted would be hugely appreciated.
EDIT
Images of two issues I am encountering.
Firstly, I get a butchered version of the localhost homepage when the browser does not redirect to https, and I follow a link from the functional homepage to another URLs (http://localhost/mysite/example) which functions on the live version:
On Firefox where it redirects to https I get the following error message:

I fixed this after a bunch of increasingly experimental tinkering.
The thing that solved the issue was deleting the htaccess file, visiting Settings - Permalinks, and hitting Save Changes. This created a new htaccess file which has allowed me access to all URLs on the site.

I have also faced the same issue. I have saved the 'settings->permalinks' page. it didn't solved my problem. Later I deactivated all the plugins one by one and I found the problem lied with one of my plugins.

Related

Wordpress site give 504 bad Gateway while html and php file is working

I have a server of my client and I deployed my WordPress website to it using an FTP account, when I try to open My WordPress website I keep getting 504 Bad gateway error as the following screenshot
I tried to add a simple HTML document and it works, also I have been attempting to add a test PHP file with phpinfo inside it and it works also, but the WordPress is not working
I also tried to disable app plugins and the same problem remains
Can anyone advise me on what I should do?
Could it be related to the site URL settings in wp-config? Info here: https://wordpress.org/support/article/changing-the-site-url/
I solved it by
Go /etc/httpd/conf/httpd.conf.
Change the AllowOverride None to AllowOverride All.
Restart the apache server.

Wordpress homepage 301 redirect to localhost

I've just moved a WordPress website from my local machine to the server. All the normal steps were done, such as updating the SQL database and setting it all up. The only problem is the homepage is 301 redirecting to my local URL even though it has the correct URL to go to. The rest of the website is fine including the admin area. So far I've done the following:
Checked the SQL database to look for any localhost URL's
Defined the wp_home and wp_siteurl in the wp-config file
Also defined it in the functions file
Disabled caching
Flushed the permalinks
Disabled plugins
Checked for hardcoded URL's in the PHP
Deleted the .htaccess file and created a brand new one
Any further ideas please?
The solution to the problem was just browser caching, just needed to load it in a different browser which was cache free

Wordpress Permalink change won't work

I want to update my permalink structure to postfix from the "plain" type, but every time I try--I get a 404 on every page I try to visit, except for the front page. I've reset my .htaccess, deleted it and recreated it, disabled all plugins, and then tried redoing the .htaccess with the plugins still disabled--but no luck.
I do think this was caused by the "Team" plugin by pickplugins...but still no luck when deleting that and redoing the above.
Any ideas?
Thanks!
Make sure server enable Apache Mode Rewrite properly. This happen all apache servers doesn't install Mode Rewrite.
I would begin by testing whether or not the htaccess file you are editing is being used by the Apache server. To test this, break it intentionally (writing invalid lines of codes can achieve this). Then see if you get the 500 Internal Server Error on your page. If you get that error, then that means your htaccess file is in fact being used by the server.
if the htaccess is working then find out if mod_rewrite is working on your server.

Wordpress not handling dynamic requests

I tried migrating my wordpress from xampp to a web server. Changed the site fields in the sql database, exported the database, updated wp-config, set permissions and uploaded the page.
The front page loads fine and I can access the admin page through /wp-admin (where everything functions) but any page request that isn't an actual file (like /admin) results in error 500.
I'm not sure how those work in PHP anyways. Is there some configuration I missed maybe? I also have access to php.ini if that helps.
Since I moved the deployment from /wordpress/ to htdocs root, I also had to edit the .htaccess file to change rewrite path.

Pages Show StaticFile Handler 404.0 Error in WordPress on IIS 7.5

I'm moving a WordPress site to a server that runs WordPress on IIS 7.5. Barf. The server is already hosting two other sites without any problems.
The new site that I migrated shows the homepage, images, and all the wp-admin pages perfectly.
When I try to view a "page" such as /about, I get a 404. IIS seems to try and handle the request with a StaticFileHandler. In wp-admin I can see the page and all the content looks correct.
How can I get this page to render correctly?
The admin page:
After clicking 'view page':
You need to flush your permalinks.
Change the permalinks to something other than what they're set at, then change them back, should flush the rewrite rules and work correctly.

Categories