SOLVED cPanel preview url: how log into wordpress admin?

USA_Webmaster

Well-Known Member
Dec 10, 2015
48
5
8
USA
cPanel Access Level
Root Administrator
How do I access the WP Admin part of my website using the cPanel preview temporary URL?

http://192.167.123.456/~username/

I went into phpMyAdmin, and edited two tables "XYZ_options" to match my above preview url.
  1. siteurl
  2. home
Now, when I visit the preview URL, everything looks great but I'm not able to visit admin dashboard / backend. Instead I get redirected to another website being hosted on shared server.

http://192.167.123.456/~username/wp-admin = broken
http://192.167.123.456/~username/primarydomain.com/wp-admin = broken

---
  1. Does this work for primary domain?
  2. Will this work for addon domains?
  3. Why doesn't this work at all?

---

SOLVED

You must edit wp-config.php with new code
Code:
define('WP_HOME','http://192.167.123.456/~username/');
define('WP_SITEURL','http://192.167.123.456/~username/');

I didn't have to update .htaccess, but you could try if the above snippet doesn't work.
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~username/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~username/index.php [L]
</IfModule>
# END WordPress
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello,

I'm glad to see you were able to solve the issue. Thank you for updating us with the outcome.
 
  • Like
Reactions: itopgun