Moving Wordpress site subdirectory errors - wordpress

I have just moved my testing development subdirectory worpdress installation to my root folder using the WP-Clone plugin.
The problem now is my main site (previously mysite.com ) shows (mysite.com/site) now. and the subdirectory is shwoing in all my links
I have tried going to settings and removed the /site from wordpress URL and Site address URL.
But it broke my site and disabled me from accessing my wp-login.php .
I fixed it by editing my wp-config.php and adding :
define('WP_HOME','https://mysite.com/site');
define('WP_SITEURL','https://mysite.com/site');
and now my website works perfectly. But it still shows mysite.com/site and i am unable to edit my URL and Siteaddress from my wp dashboard anymore.
How do I Remove my website subdirectory (/site) and still have it work and not break my site's themes and all? How do I go about this? Really really appreciate any help! Thanks!

By adding those constants to wp-config.php you're overruling any setting in the database. That's why you can't edit them in the admin panel.
So the first step is to change those constants to:
define('WP_HOME','https://domain.com');
define('WP_SITEURL','https://domain.com');
Then delete your htaccess file. (.htaccess in your root folder).
Once you've done this navigate to http://domain.com/wp-login.php
Login to your site and go to Settings -> Permalinks. Hit save which will regenerate your htaccess file.
Finally you'll need to update existing links. I'd suggest installing a plugin called 'Velvet Blues Update URLs'.

Related

Cannot able to access wp-admin page

I have a wordpress website in my ubuntu server. Eg, my website url is
xyz.com. when i'm trying to access wp-admin page it should be xyz.com/wp-admin. But it redirect to another url like xyz.com/xyz/wp-admin
Can anyone give solution for this issue?
Wordpress admin dashboard is /wp-admin from whatever directory your website is installed.
For instance, you have a website https://dijofrancis.com and wp is installed in the root directory then your admin url is https://dijofrancis.com/wp-admin
If you paste your .htaccess file (situated at the root of your webserver directory) we could help a little more.
I once had a similar issue when I stupidly made a global redirect with a wildcard on my website.
If you say that when you access:
xyz.com/wp-admin
it redirects you to
xyz.com/xyz/wp-admin
Then it might be a permalink issue.
Re-make your permalinks from WP dashboard.
Also, you can try to use
https://wordpress.org/plugins/wps-hide-login/
and test from another link (if issue is permalink, maybe WPS HL will interact with wp-admin in a way that will work for some reason)

Wordpress always redirects to /wp-login.php

i have a problem with one of my wordpress websites. Every time i want to open to home url it automatically redirects me to the /wp-login.php with this strange url:
https://example.at/wp-login.php?redirect_to=https%3A%2F%2Fexample.at%2F&reauth=1
Also i can't use the "Back to example.at" Link under the login window.
Site & Home URL are set correctly, also there is no redirection set in any plugin or in the .htacces. Also all safety plugins are disabled.
Does anyone already had this strange problem?
Make sure that your website plugins works good.
For first disable all plugins or rename /wp-content/plugins folder then check your website. If problem solves rename back the plugins folder and try to rename plugins directories step by step and find problematic plugin.
Try change the main theme and recheck problem, look at your main theme function.php file content, if you see the obfuscated codes, delete this codes and recheck website.
Delete wp-include, wp-admin folders and reupload from offical wordpress.org last version archive,
Install Wordfence av plugin and scan your website files. maybe you have injected codes.
check your .htaccess file, try to reset it.
Check your server and wordpress requirements. Change the php version to 7.2.
Disable your cahce plugins (if you have).
Try to debug your website with this steps.

Wordpress redirecting to wrong homepage

I worked for a few days on XAMPP with a wordpress platform. After I bought a domain, I decided to use Duplicator plugin to transfer my whole wordpress snap to the new server. Everything is working just fine except for one single thing: whenever I go to my website, instead of visiting the actual page that should be "www.example.com/welcome" it redirects automatically to "www.example.com/wordpress". I made some research about it and discovered that usually wp is installed in a wordpress directory, but I completely made sure that:
on htaccess there is no /wordpress directory url
on index.php there is no /wordpress directory url
on wp-config there is no /wordpress directory both on SITE-URL and HOME
made sure that on the wp-admin config panel in the General section, the URLs are both set to the root directory.
For some unexplicable reason, everything is working fine, www.example.com/shop works for example, but if I set from the customization panel a page like "www.example.com/dummy" as homepage, then THAT page won't be found because it automatically redirects "dummy" to "/wordpress" which of course does not exist. You can type www.example.com and be redirected to www.example.com/wordpress and the same thing happens if you type www.example.com/dummy, since now that should be the homepage.
Can anyone explain me why is this happening? I searched everywhere but I can't find an answer.
I'm using the Storefront theme and Woocommerce plugin if that might help.

Wordpress blog doesn't show up online?

I have created a self-hosted wordpress blog and on my ftp server everything is under
/public_html/wordpress/..
then you have /wp-admin and /wp-content etc..
but when I got to my website the theme doesn't show up, it only shows a white page with
www.******.co.cc
" index of
/wordpress"
I figured out the wordpress blog has installed its own directory so if I want to see my website I need to enter that directory first. So I tried to type
www.*******.co.cc/wordpress/
and it worked my website is all here.
BUT ! I don't wanna have people to type www.**.co.cc/wordpress/ since the site was originially known without adding /wordpress at the end.
If I move all my wordpress folders under the root
/public_html .. will it work ??
See http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory to move the site to root.
After the move, if all you see is "index of...", add
DirectoryIndex index.php
at the top of .htaccess
Under Settings > General
Check your site address(url) and wordpress address(url) to make sure they are set how you want them.
The site address should have the url for where you want people to view the page (without the wordpress extension. )
You most likely also have to move your index.php and .htaccess file out of the wordpress file and into the root folder.
Go here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory and
View the instructions under the heading "Using a pre-existing subdirectory install"
It is good to have FTP running while you do this in case you lock yourself out of the admin by inserting an incorrect filepath.
This is because you have installed your wordpress script in the
public_html >> wordpress
Install your wordpress in the root i.e left the directory field empty
/

Wordpress in same directory with default page

I think I'm needing help with .htaccess here.
I have a page that was named index.php. I still need that to be the default page but with a new name AND I need a wordpress install in the same root. So here's what I've done:
Renamed index.php to somethingelse.php
Created an .HTACCESS with this line in it: DirectoryIndex somethingelse.php
Now if I go to www.site.com it brings up the www.site.com/somethingelse.php page (as it should).
Next I installed Wordpress into the root. That went well too.
The problem is I cannot access wordpress via www.site.com/index.php when I do that it just kicks me back over to somethingelse.php page
I'm thinking there is something I need to add to .htaccess so that if:
1) Someone types www.site.com it goes to www.site.com/somethingelse.php
2) Someone types www.site.com/index.php it goes to the wordpress install
Just for clarity, the reason for this is that in about a week, somethingelse.php will go away and the wordpress install will be the live site.
Any help is appreciated
I fixed it by creating a separate page that only I can get to to set and destroy a cookie. then in the header.php of the WP file I check that cookie and determine where to go.

Resources