Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to change the URL direct for the wp-login page. WordPress


Hello WP People
I just had a website created in WP. I want to take this website and use it for a second website(domain name).

I am hosting the site at HostGator. I copied the WP code from the original folder inside the public-html folder to the new folder inside the public-html folder.
The second website is coming up great. Heres the problem when I attempt to login at the second website it takes me to the original website

Here what I mean brings up the admin login. i login and then the URL automatically changes to

i can get into the cpanel file manager to edit the files in the secondwebsite folder.

i am pretty sure there is one line of code that i need to change from to

thanks in advance.

hey guys.
i just wrote a huge summary and left the computer for more than a hour and it all got erased when i had to re-login....grrrrrrrr

heres the two sites

heres the short version
i did the change to the config file. i added the two lines of code for the url.
when i logged into the bioforce wp admin it asked to do a database update.
the bioforce site is missing a bunch of pages..weird

Answers (4)


Andrzej answers:

add this to your wp-config.php file:


obviosuly using the new path for your website. Should do.

Andrzej comments:

@MagoryNET read carefully, his problem is he cannot access the admin panel ;). To safe dirty work with phpMyAdmin, the fastest way is set it up in wp-config.php as I postedd (overriding DB settings by that). After, you can apply changes to DB and remove the lines.

Andrzej comments:

You also need to duplicate the db same as files, not sure if you already did?

Andrzej comments:

I can try to look into your problem but need additional budget.


Jarret Minkler answers:

Andrzej Wins :(


MagoryNET answers:

You need to login on the old page and change on wp-admin/options-general.php the url of the page to the new one - it's a change in database not in the files.


Monster Coder answers:

If you are using same database, the solution is already given by Andrzej! However, if you are going to use separate database, you need to take some trouble, as I guess you can't login to go to wp-admin/options-general.php as said by MagoryNET!

You need to go to phpMyAdmin and update the 'home' and 'site_url' field to new path in *options table after you have copied the source database.

You also have to update the guid in *posts table as the URLs will be prefixed with previous URL.