I will be designing and developing a website for a client but want to allow the client to add content while I am working on the design and development of the site so that it is pretty mich done by the time I am finished.
Currently, I use XAMPP on port 81 so my project URL looks something like
http://localhost:81/projectname
My wp-config file has all the settings I need to the remote DB and yet, when I run the
http://localhost:81/projectname
URL it constantly redirects me to
http://localhost/projectname.
I’ve removed all htaccess files thinking the problem was there but that didn’t work. My ISP suggested opening port 3306 which I have done but that’s not done the trick either.
I don’t know if it has to do with port 81 on Xampp perhaps?
EDIT:
General settings link through to the online version of the site so
Site Address = http://example.com
WP Address = http://example.com
Many thanks
I think s_ha_dum is in the right track, but I think he got it backwards.
You want to:
You need a remote (staging) installation of WordPress, where the client can create/enter his content.
You need your local WordPress site (localhost) to point to the remote database, to grab the content he is using.
So, you would have your http://example.com/wordpress set up for the client to edit – just even with a vanilla WP install. This site would be connected to it’s own database.
Your localhost site would have the REMOTE site’s database credentials, with the
DB_HOST
set to http://example.com, or whatever the mySQL path is if it’s accessed another way through your hosting provider.On your local site, keep the
WP_SITEURL
andWP_HOME
set to localhost. Otherwise, you’ll get redirection loops.If the remote server supports it, you can connect to the remote database. Just set your connection constants correctly:
You will almost certainly also have to set these on the local install:
I can almost guarantee that you are still going to have issues, not to mention that changes you make are to the live server.
There are other potential solutions, like database mirroring, but that would be off-topic here and I’ve never done it.
My advice is to just copy the live database to your local server at the project start and do not try to sync the databases or otherwise connect the development site with the live one. You are asking for trouble. WordPress does not have a sharp content/config separation in the database.