Can't change WordPress Address (URL) - wordpress

I want to change WordPress Address (URL) and Site Address (URL). after a few experiments unfortunately using wp-admin or even changing it on phpmyadmin wordpress cannot be accessed.
What I have tried:
1. I try to change the URL in the general settings of the wordpress is still redirecting to the old url & page 404 not found.
Then I try in the same config.php it can't be 404
I change it in phpmyadmin (db) in the same wp_option it can't.
Please help, thanks, in advance
I want to change the url as follows:
https://example.com/spm to https://example.com/

There are several ways to do this:-
Edit wp-config.php
It is possible to set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php, where example.com is the correct location of your site.
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
OR
Change WordPress URL Directly in Database
In phpMyAdmin, click on your database on the left-hand side. Then scroll down and click on the wp_options table. If your database has a different prefix it might be named slightly different, such as wp56_options.

Thank You everyone, my issue solve finally.
the problem is my wordpress in subfolder on host. so when i want to change for example to root url or something else.
Move the root wordpress to public html
Move the wordpress file to Public html

Related

Not Authorized to View This Page

Can someone help when visited in https the error stated that "Not Authorized to View This Page [CFN #0004]" but in Http the site load or work without having an issue?
Reset the URLs to their http version. You can do this via PHPMYADMIN in the wp_options table by locating wp_home and wp_siteurl and adding the http:// version of your website or by adding constants in wp-config.php:
Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
Reference: https://wordpress.org/support/article/changing-the-site-url/#edit-wp-config-php
The latter is probably the easiest.
To make your site use https, you must FIRST install a valid SSL certificate. Contact your host for assistance with this.
Credit: https://wordpress.org/support/topic/http-to-https-website-crash/
Move your site from the public folder in your FTP to the secure folder. This will fix the issue.

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 fix broken Wordpress domain

In my Wordpress site's settings I changed the URL from http://www.lauraspantry.uk to http://www.allstaruhlmann.co.uk - stupid mistake, double so as I meant to add http://www.allstaruhlmann.com - I can now no longer access my site and get the following error
How can I resolve this and restore the original URL?
Just add this to your wp-config.php (via FTP or SFTP) :
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Where example.com is your correct url.
Further info:
https://codex.wordpress.org/Changing_The_Site_URL
You'll have to go into your site's database and change siteurl in WP_Options. Usually you would use PHPMyAdmin. Available in your CPanel.

Stop subdomain redirects to main domain in wordpress

I have a website that is build in WordPress.
I want to build the sub-domains for the site according to the states same as "olx.in" do for different cities.
Everything is setup from the code, server and hosting side, but the problem I am facing is that when I type any sub-domain in the URL like "rj.mysite.com" then I there is somewhere somthing written in the wordpress php file, that is redirecting me to the main domain because I made many changes in the .htaccess file but nothing worked out.
I have tried so much but couldn't found the script that is redirecting the sub-domains to the main domain.
Can anybody please tell me that what should be there in the php code of WordPress that is redirecting my sub-domains to the main site?
just found the answer today, hope you've solved it, assuming you have,
what i did for mine was create another wp-config.php file, named it wp-config-sub.php, then in your sub domain, require the wp-config-sub.php file, instead of the wp-config.php file,
require_once '../wp-config-sub.php';
then go back to your wp-config-sub.php file and comment out these lines
/* Multisite */
//define( 'WP_ALLOW_MULTISITE', true );
//define('MULTISITE', true);
//define('SUBDOMAIN_INSTALL', false);
//define('DOMAIN_CURRENT_SITE', 'yoursiteprimaryurl.com');
//define('PATH_CURRENT_SITE', '/');
//define('SITE_ID_CURRENT_SITE', 1);
//define('BLOG_ID_CURRENT_SITE', 1);
hope this will solve your problem. :)
if everything correct in the NS records and the domain redirects
I think you need to login to wordpress and change in the general settings
WordPress Address (URL)
and
Site Address (URL)
to your sub domain or to check your .htaccess file

Why does my page redirect to localhost in my wordpress blog?

This is my site URL http://www.weblogicsol.com/ , Here I installed a wordpress theme having URL http://www.weblogicsol.com/blog , the problem is this when I want to open the wp-admin (means when I write http://www.weblogicsol.com/blog/wp-admin) it redirect to
localhost. Please help me to solve this problem, I am in trouble.
And if I write this code in wp-config file
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
then this URL appears with an error message.
http://weblogicsol.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fwww.weblogicsol.com%2Fblog%2F%2Fwp-admin%2F&reauth=1
Check your wp-options table and find all occurrence of 'localhost' in option_value field
http://codex.wordpress.org/Database_Description#Table:_wp_options
SELECT * from wp_options where option_value like '%localhost%';
and change those to your live URL and you should be set
Here's a very extensive documentation on migrating wordpress
http://codex.wordpress.org/Moving_WordPress
Check the Dashboard -> Settings -> WordPress Address (URL), Site Address (URL)
There should NOT be 'localhost'
Here is the way.
1. Login to Phpmyadmin
2. select Db
3. goto table "wp_options"
4. change url in siteurl & home.
its works 100%
There are two areas in the WP_OPTIONS that you need to change. One is one the fisrt page and the other one is on the 2nd page.
This video will definitely help if you have access to phpMyAdmin
http://educhalk.org/blog/?p=21
you should check wp_options on your database , modify site url dan home as your web domain

Resources