Problem with url moving site from subdomain to main domain in Wordpress - wordpress

Guys, I've a site that was moved from sub.domain.com to domain.com. To do this I used Backupbuddy plugin in Wordpress. The problem is..Everytime any user try to access to some old page url (domain.com/testpage) and the page doesn't exist, are being redirected to sub.domain.com/testpage where the page previously existed.
Any idea how to fix this?
Thank you.

you have to make change in your .htaccess file in your server or host. always redirects are in that file. if you are using cpanel you have to make visible hidden items in settings.

I think the first port of call would be to check the URL in Wordpress matches the database table URL, if so update the Permalinks and retest.

Zip .htaccess to make a backup and remove the .htaccess file. Then, save your permalink again to generate a new .htaccess and check.

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)

domain redirecting to localhost/wordpress

this is my first time, I am installing a wodrpress localhost(xampp) to main server.
According to tutorial I Imported database from local machine to main server. Changed the the table prefix and http://localhost/wordpress to https://example.com.
after installing theme domain shows empty theme.
I changed all the http://localhost/wordpress used on theme. But didn't work.
Then according to another tutorial I imported full localhost wordpress file.
Then It redirecting my domain to http://localhost/wp-wordpress. Then I decided to fully reinstall the wordpress and as per I removed file from public html which I uploaded.
Now my domain redirecting to http://localhost/wp-wordpress after removing files I uploaded.Public html folder
my site
After reinstalling wordpress on server admin dashboard working fine but domain redirecting to localhost/wp-wordpress
You can change the url many ways in wordpress. You can use to change the url as you understand and follow the steps as I mentioned in below,
Change WordPress URL in Admin Dashboard
Change WordPress URL in wp-config.php File
Change WordPress URL Directly in Database
Change WordPress URL With WP-CLI
Get More understanding the details, Follow the article - How to Change Your WordPress URL
Thanks!
After checking wp-config.php and site_url,home_url in wp_options table in database. Take a view on .htaccess file too. This file should look like this htaccess code
Please change the site_url from the wp_option table. There are 2 rows containing the website base url in the wp_option table. You need to change both url to the main domain url.
Thank you

How to get sub-domain of Wordpress in url structure

I have created a Wordpress install on a sub-domain of my server. So for example my url is www.myUrl.com and I created a subdomain that is essentially www.myUrl.com/sub. I installed Wordpress on www.myUrl.com/sub and it works fine.
The site shows up on that new url as it should BUT when I click a link, lets say 'blog', instead of taking me to www.myUrl.com/sub/blog it takes me to www.myUrl.com/blog.
I am pretty new to wordpress and have looked up the issue but can't find any answers. I have messed with the absolute path stuff inside the .wp-config file but cant' figure out what to do and if this is indeed the file I need to change. I have also tried to find this on the permalinks page.
Please let me know what other information you need to help me answer this question and thanks in advance.
It looks like your home URL is defined as "www.myUrl.com" in the database. U can find this in the wp-options table in the database or in WordPress at the general settings. When I move to a subdomain I also delete the .htaccess and save the permalinks page of the settings so the .htaccess gets a refresh.

Change WordPress URL folder name to another without redirecting

I'm trying to change my WordPress site's URL (without redirecting) from:
example.com/go/take/
to:
example.com/go/give/
Also, if my wordpress site is located in the /go/ folder, is it possible for me to trim /go/ ?
Thank you.
These are two separate issues.
Regarding the first issue, are you saying that you still want a user
to type in example.com/go/take, but be served the file from
example.com/go/give without changing the url? You can install the
wordpress redirection plugin to do that. You can create a 'pass
through' redirect which will do this.
Here's what you can do to run example.com from a wordpress install
in the go subdirectory:
http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Moving Wordpress site subdirectory errors

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'.

Resources