404 after changing URL in wordpress? - wordpress

I wanted to make a website for my dad on his birthday. He already had one active through one.com with the URL www.virumfarveogtapet.dk.
I made one with wordpress on the URL test.virumfarveogtapet.dk and when I decided for it to be nice enough to go live I changed the URL with wordpress to the actual www.virumfarveogtapet.dk.
When i try to log into it www.virumfarveogtapet.dk/wp-admin it gives me this error
Not Found
The requested URL /wp-admin was not found on this server.
And if I try to access the website through www.virumfarveogtapet.dk it refers to my dads old homepage.
When I go into wordpress it still stands as test.virumfarveogtapet.dk but when I click it, it refers to my dads old homepage also.

It seems you have changed the URL of the WordPress installation to http://www.virumfarveogtapet.dk/.
You may be able to login and change the URL back to the "test" subdomain here: http://test.virumfarveogtapet.dk/wp-login.php
If not try updating the site URL with via FTP in wp-config.php or functions.php as per the docs: https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

Related

How to access the home page of WordPress from a cPanel staging URL

I have a cPanel hosting package, and the staging url is this format: https://cpanelserver.com/~cpaneluserid/.
This does take me to my WordPress site. However, it takes me to the WordPress page "Oh no! No content is appearing for this page!".
Obviously the /~cpaneluserid/ part of the staging url is not recognized by WordPress as a valid page name.
If I try to tack on an interior page name like this: https://cpanelserver.com/~cpaneluserid/about-us/, I still get an "oh no" unrecognized page error.
I don't reach my website if I try removing the the cpanel userid from the url like this: https://cpanelserver.com/ or remove the tilda like this: https://cpanelserver.com/cpaneluserid/.
Has anyone been able to use a staging URL with a WordPress website from cPanel hosting with this same URL format?
UPDATE:
Because my cPanel 'staging URL' has the user-id as a sub-directory, as in
this format: https://cpanelserver.com/~cpaneluserid/, that means
that no one with a WordPress site will be able to use this staging URL format.  That is because WordPress interprets the /~cpaneluserid/ as a page name.
And trying to navigate away from this invalid page (page with no content) doesn't work, as this coding: <?php bloginfo( 'url' ); ?> will always return https://cpanelserver.com/~cpaneluserid/, so the new page link will give you this URL: https://cpanelserver.com/~cpaneluserid/newpage/, showing the 'newpage' as a sub-directory of this invalid page '~cpaneluserid'.
Instead, the hosting company should be creating the staging URL with the user-id as a sub-domain, as in this format:
https://cpaneluserid.cpanelserver.com/.
I just heard from my hosting company, and they had this excuse: "Unfortunately we are not providing a staging URL on the cPanel platform due
to the number of potential security risks that are associated with it."
So basically no-one with a WordPress site on a cPanel hosting package can show their clients their website design, to get their approval, before they go live.
I am not sure why the hosting company thinks that this url: https://cpanelserver.com/~cpaneluserid/ is any less risky than this one: https://cpaneluserid.cpanelserver.com/?
So it looks like there is no answer for this post.
But now I am curious how other cPanel hosting companies deal with this 'security risk' of having a valid staging url.. or do they all use the same format as mine?
 
I finally solved the problem.
It turned out to be a rooky cPanel user mistake!
I had used the cPanel server name for the WP_HOME and WP_SITEURL WordPress settings (ie: https://cpanelserver.com/), instead of the actual location of my hosting package on the cPanel server (ie: https://cpanelserver.com/~cpaneluserid/).
The way I had the settings meant that WordPress ignored the part of the URL that was the defined as the siteurl (ie: https://cpanelserver.com/), and treated everything after that as a page name (ie: /~cpaneluserid/).
So when I used https://cpanelserver.com/~cpaneluserid/. to view the site online, the cPanel hosting package correctly got me to the root of my website location, but WordPress didn’t take me to the home page, instead it took me to the non-existent /~cpaneluserid/. page.
If I had gotten the server name wrong in the WP settings, then I would not have been able to see my site, and would immediately know it was an issue on my side, and would have figured out this issue sooner.
But since I had the server name correct (even though the url was incomplete), I was able to view my site, and know that the database was correct.. so I erroneously thought that my WordPress settings were also correct. Instead, I was thinking that the page presentation & navigation issues where a problem with cPanels temporary URL format.
So in case anyone every has the same problem, I wanted to document it here.
IF you are using your cPanel's staging (or temporary) URL to access
your site before it goes live, then BE SURE TO use the full URL that
points to your cpanel hosting package - which should include your
cPanel user ID as in: ‘https://cpanelserver.com/~cpaneluserid/’ in the
WordPress settings of WP_HOME and WP_SITEURL.

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

i am redirected to another site on successful login

i recently took over a wordpress site that is a sub dormain of an eCommerce site.
i have installed it on my local wamp and i now wish to log into the wordpress dashboard.
the problem is that the once i log in to wordpress it redirects me back to the old site.
i am now trying to work out where the redirect functionality might be located.
i have already changed the base url address in the table wp_options.
within this table i changed both the siteurl and the home.
i also tried changing the wp-config.php file with the new url:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
i would appreciate any ideas on where the redirect functionality might be located.

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.

Moved wordpress directs to old URL

I just moved my wordpress site to a new sub domain. However the homepage still directs to the old url: wordpress.bysuonpera.com.
It should direct to photographer.bysuonpera.com
Anyone know where I can change this?
I already change the URL's in the wordpress settings menu. But this did not change the issue. Also, accessing wordpress through cpanel also directs to the old url.
Hope someone has an answer.
Moving Wordpress is pretty straightforward. However there are some things that could be messed up, if you dont follow the guide. Ideally, you should change the URL setting in dashboard before transfer. However you can do it later on too, use this section of the above manual.
As soon as you manage to login to dashboard on a new WP instance, download, activate and use two following plugins to replace old URL with new URL on your WP instance:
Velvet Blues Update URLs
Better Search Replace

Resources