I am working on a website with wordpress locally. I have a project that when I run it in firefox or chrome it redirects me to another site that I also have on localhost.
Example: I want to open
localhost/new-project
but it automatically redirects me to
localhost/old-project
I already tried the following:
modify siteurl and home from wp_options in phpMyAdmin
modify the urls from the wordpress panel
check the SITE_URL in wp-config
All of the above is correct. I don't know what else to do to make it work.
Just close the active port in which the old project is running than try.
Related
I have cloned a live Wordpress website into local environment (using xampp server), the main page of website is working http://localhost/foldername, but when I try to go any other link, it returns me to the http://localhost/dashboard url.
I already changed:
wp_config.php
set the new domain in database
set new username and password of database.
Thanks in advance for your nice directions.
In your wp-config.php file add the following two line
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
In the place example.com put your path then run your url/wp-login
I have ran into quite the issue.
I have been developing a website hosted locally with MAMP. I always used localhost:90/wordpress/ to access the website and it was worked up till today. A few hours ago, I began the process of moving the website from local server to an actual domain. Unfortunately, I wasn't checking URLs and ended up changing some information and working on localhost myPHPadmin panel as opposed to the domain myPHPadmin panel. Long story short, I changed so much before I realized my mistake, then proceed to change even more, and now I am lost and don't know what to do. At this point, I am just trying to get access to my local hosted website so I can start over again.
The issue:
Everytime I goto localhost:90/wordpress, Chrome redirects me to localhost/wordpress and my website doesn't show, it says that the website can't be shown.
I have tried going into my local hosted myPHPadmin panel and changing siteurl and home to both say localhost, but no luck. Interestingly, when I change both to wordpress, it shows an unformatted version of my homepage (Kinda like just straight HTML), with limited images, however if I click any links then it brings me to wordpress/about and it doesn't exist. If I change it to just localhost:90, it shows my unformatted wordpress Page not found page. Can't access wp-admin with any of them.
I have tried using a replace tool recommended in another thread, but searching for localhost and replacing with localhost:90 yielded no results for me. I have also double checked the .htaccess folder and it is correct. I have cleared cookies/cache and still nothing. I am desperate.
Any help is much appreciated.
I am not sure what the issue is here so I am going to shoot in the dark here and hopefully one of these methods will get you out of your predicament. Since you say that you have reverted all the changes you made and still your website is inaccessible, even wp-admin.
You can try doing the following:
Change the siteurl and homeurl links in your PHPmyadmin to localhost:90/wordpress or whatever it was before when your site was running and functional.
In your Wordpress root folder, there is a file called wp-config.php. Open that file and find:
* #package WordPress
*/
Add after:
define('WP_HOME','localhost:90/wordpress');
define('WP_SITEURL','localhost:90/wordpress');
You will replace all localhost:90/wordpress if need be by which I have written in my codes to what the link was before; when the site was functional.
Check the file thoroughly and through Find/Replace function of your favourite text editor for no duplicate entries.
Now try accessing wp-admin. If you still cannot access your wp-admin, take a backup of your current wp-admin folder.
From a fresh Wordpress of the same version as yours, copy the wp-admin folder and replace it with your current wp-admin folder. Now try to access wp-admin again.
If you are able to access it and login, refresh your Permalinks. See if your site is accessbile again after doing these steps.
Update:
Since none of those steps worked for you, try doing the following:
Delete all the Wordpress core files from your localhost:90/wordpress EXCEPT wp-config.php and your wp-content folder.
Now from a fresh Wordpress folder, copy the files and folders EXCEPT wp-config.php file and wp-content folder. Paste them in your localhost:90/wordpress folder.
Try accessing your website now.
Update 2:
Try uploading your Wordpress to your online server and change the values of siteurl and homeurl in your wp-config.php file. We defined the localhost addresses in the file, now you will update those with your domain details.
Take a fresh backup of your database from your localhost and import it into a new database in your online server. Update the homeurl and siteurl in your newly imported database.
Update your wp-config.php with the new database name and username and password of the account you have given all privilages to access the database.
Try accessing wp-admin now.
If successful, update your Permalinks and then try accessing your website.
This will tell us if your localhost is faulty.
I am trying to get a client's WordPress site copied over to my company's server to use as a development site. I've ran into an issue when trying to log into the site's administrator panel; it redirects us to the existing site's URL instead (ending up as [OLD SITE]/[NEW URL]/wp-admin). Additionally, trying to go to any page other than the homepage gets a 404.
I've tried editing the wp-config and defining the WP_HOME and WP_SITEURL there, with no success. In a previous attempt we used a backup tool that was meant to replace references to the old URL with the new URL, and on another we ran queries and checked through wp-options in the database to be sure that we caught all of the old references. Still redirects to the old site.
We've tried restoring from two backups, Akeeba and BackUpWordPress. Our current attempt is a copy we've downloaded directly and then uploaded (with an imported SQL backup).
Another odd thing I've noted is that changing one of the URLs in the database causes more issues. Mainly, if I update the URL of 'wordpress-https_ssl_host' in the wp-options table, the theme breaks. Not sure where to go with this from here.
I'm always succesfully using the following script : search & replace:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
in order to update a wordpress site url.
Just copy the provided code in a directory under your site, then launch the provided index.php in a browser: the database infos should be automatically determined. Then specify the old and new urls and click on "Run" !
Don't forget to remove the created directory afterwards.
For solving this issue you have to change siteurl in database wp_options table
option_name = siteurl where
option_value = YOUR OLD SITE URL
change your old site url and update it with your local developement site URL
Hope this will help you..
We found the problem; as it turns out it was nothing to do with anything from the default WordPress files. The client was using an extension called WordPress HTTPS, and apparently that was causing a conflict somewhere. We renamed the extension's folder to disable it and everything ran fine. I imagine it was overriding what we were setting in wp-config.
I have a Wordpress website, which runs on a Linux server. I had to rebuild my Windows PC recently so I am trying to migrate the website from www.mywebsite.co.uk (Linux) to localhost (Windows). I have followed all of the instructions in this video: wordpress on localhost linked to live site i.e.
1) PHPMyAdmin: Export MySQL database from live website and import it to MySQL on localhost.
2) Filezilla: Download website files over FTP
3) Run SQL statements in the answer from this question: wordpress on localhost linked to live site
4) Change username, password and hostname in wp_config
5) Add the two define statements from here to the wp-config: wordpress on localhost linked to live site
6) Used this tool: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Still when I browse to my site: http://localhost/mysite; it redirects to www.mysite.co.uk. Is there anything else I can do? Could it be the theme?
Update
I have made the following changes to my wp-config:
defin( 'DOMAIN_CURRENT_SITE', 'localhost' ); //was www.mysite.co.uk
define( 'MULTISITE', false ); //was true
I can now access my homepage and admin (wp-admin). However, when I click on other links e.g. About Me, Site Index etc; I get a 404 error.
Wordpress remembers the domain that you installed it in. You need to explicitly tell it to change the default domain.
Please read the Wordpress codex: Changing the Site URL
P.S. I believe you're doing this as an intermediate step in your migration, right? There is no way for people outside to access your site with http://localhost
I have a WordPress installation on my localhost: http://localhost:8888
I've uploaded the wp files on my FTP, and I've imported the DB. I can't use a new installation because I've edited some core files.
I also edited the table wp_options on my site, and edited the fields, siteurl and home so those two fields contained the site URL, changing them from "localhost:8888" to my new URL.
The problem now is when I go to my URL and try to load the website it will redirect me to http://THE_NEW_WEBSITE:8888.
I need that port removed. How can I do that?
you don't need that port removed, you just haven't changed the base url of the wordpress install everywhere you needed to. check your .htaccess file in the directory where you installed wordpress. see if there is anything in there with the old url left over, ie. the url with port 8888. if it's wrong, replace it with the new one.
otherwise, try grep-ing through the directory for :8888 and see if that string exists anywhere its not supposed to.
use wingrep if you're on windows: http://www.wingrep.com/
Here's a tutorial on grep if you're not familiar: http://www.unixref.com/guides/grepGuide.html
I had same issue. All I had to do was to use another browser. The problem was cache.
Solved before explorting the database change the url from the wordpress admin page and after that export the DB
I was having the same problem. I was running MAMP with ports 8888 and 8889 and installed Wordpress. When it asked for my port put in 8888.
What happened was it hardcoded the URL location to be localhost:8888/wordpress, so when I wanted to change the port to 80, it would redirect me there from localhost/wordpress
What I did was run MAMP with the original ports, 8888 and 8889, which allowed me to access the dashboard, from there I went to the "Settings" tab and change the "WordPress Address" and the "Site Address".
When I clicked "Save Changes" it brought up an error page, presumably because now it was being forwarded from localhost:8888/wordpress to localhost/wordpress, but when I switched the port back to 80 on MAMP and went to localhost/wordpress I was able to access everything again.
I had the same issue when i was trying to run a WordPress site using XAMPP which was originally created and run by a mac user using MAMP.
I fixed the issue by removing the :8888 part from siteurl and home properties in the wp_options table in the database and clearing the browsing data (Cookies and other site data / Cached images and files) of the browser.