Wordpress not handling dynamic requests - php

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.

Related

Cannot edit pages are migrating wordpress hosting and domain - Error- post.php

I just migrated a Wordpress website to another hosting and domain.
After migration, I'm not able to update pages.
Below is the link of the error I get, when I try to update the page.
I have already increased the memory limit to 512MB and the corrupted htaccess file is also renamed.
It looks like you have placed your .htaccess file in wp-admin folder? Wordpress requires you to keep that in the root folder which is used to redirect post.php. When you access would-admin url it must be opening, while on submit the htaccess is redirecting.
If this is not the case, please share the contents of your htaccess.

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

Change Startup Page of a WordPress website

I have an installed WordPress website.
I'm working on the site, therefore, I want to show a constructor page for the internet user. I have created a page which called first.html and I change the .htaccess file like below
#Alternate default index page
DirectoryIndex first.html
Now when I enter my domain name on the browser I can see the first.html. This is working properly.
I'd like to see my changes by entering the domain and page name on the browser like
www.mydomain/index.php
or
www.mydomain/wp-content/themes/XXXTHEME/index.php
However, my theme pages don't work.
How can I achieve to do this?
Instead of making changes in .htaccess, I'd suggest you to use this plugin : https://wordpress.org/plugins/maintenance/
Simply name your html file "index.html"
Web servers most commonly parse the index.html file firstly (unless told otherwise) and if it is not found, it proceeds to index.php
This also allows you to simply change that ".html" part to ".php" to see the website you are working on, without installing plugins that clutter your database or making unnecessary changes to your .htaccess file.

403 Forbidden Error - iPage

I have an issue with my website, I linked it with Wordpress but there's a sub-menu where I get a 403 forbidden error.
This is the folder in iPage
And here's the Wordpress page I want to show up
I tried removing the .htmaccess file and refreshing the permalinks but it didn't work at all.
Any help?
Noo, Wordpress dont need any folders.
Wordpress works with the .htaccess
You can delete this folder and restart your server.
You don't have to add any directories or files after WP installation is finished, all WordPress functions will work via administration panel. But let me explain what is going on.
The 403 forbidden error you are getting is normal and expected webserver behavior in your case.
The webserver checks the request (the URL given) and tries to determine if it is a file or a directory. In your case it is a directory, which (by default) makes your webserver serve index.html or index.php file inside that directory.
However, if no such file exists, the webserver's next step is to list all items in a directory, which you don't want and is disabled in your case (and in most web server's by default for security reasons), thus webserver returning 403 forbidden error.
You can try to add a file named index.html inside your directory and see what happens, the 403 forbidden error will be gone and webserver serve your file.
If you want to serve your WordPress page instead of the actual directory you have on the server, you will have to remove or rename the directory on your server, or rename the permalink for the WordPress page.

Sub-pages always open domain root

I'm having a strange problem with a new PHP page I´m writing. Everything seems to be loading/redirected to the domain root page.
domain.com loads fine
domain.com/page or domain.com/page/index.php always loads "domain.com" while retaining the /page/index.php in the browser URL.
Even domain.com/some_random_text loads "domain.com"
I suspected the .htaccess file, but there is none to be found. There are no redirects in the PHP code.
If I remove the domain.com/index.php file I get an Internal Server Error when opening domain.com/page/index.php
This domain did have Wordpress installed, but I did uninstall that via cPanel.
First thing to notice is that the .htaccess file can be anywhere in the path that is handled by Apache. So check everywhere. This kind of redirect could be made only like that.
This can only be done by Apache, so you might also like to check the apache config if you are running on a virtual machine or dedicated server.
Also, not that it might have been a wildcard redirect, added by the cPanel, so check those settings. Though I think those actually just modify the root .htaccess file.
Based on the data you provided I cannot say more, but I don't think this is a common issue.

Categories