Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED cPanel preview url: how log into wordpress admin?

Discussion in 'General Discussion' started by USA_Webmaster, Nov 28, 2017.

  1. USA_Webmaster

    USA_Webmaster Active Member

    Joined:
    Dec 10, 2015
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    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
     
    #1 USA_Webmaster, Nov 28, 2017
    Last edited: Nov 28, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm glad to see you were able to solve the issue. Thank you for updating us with the outcome.
     
    itopgun likes this.
Loading...

Share This Page