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!

SOLVED Moving a wordpress site issue

Discussion in 'General Discussion' started by Robin Ball, Apr 22, 2018.

  1. Robin Ball

    Robin Ball Registered

    Joined:
    Apr 22, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Website Owner
    Hi All, first time user.... hoping that the cPanel collective genius can help me with this issue.

    So, I'm moving a Wordpress site for a friend. Usually not an issue at all, done it a load of times both with a plugin and manually.

    This one is a little different... I have never seen this structure in a domain folder before. I have attached a picture.

    Here is the contents of the .htaccess file:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^DOMAIN_HIDDEN\.ie$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.DOMAIN_HIDDEN\.ie$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^/?$ "http\:\/\/www\.DOMAIN_HIDDEN\.ie\/" [R=301,L]

    Usually the wp installation is in the root domain folder.... but this has www & shop in it.

    The shop folder holds the ecommerce part of the site, but that's another days work.

    Baffled!

    Any help would be seriously appreciated as there's a tight deadline.
     

    Attached Files:

  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,261
    Likes Received:
    390
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Robin Ball

    Robin Ball Registered

    Joined:
    Apr 22, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Website Owner
    The WP docs are not really the solution, as mentioned I have moved a site many times. My question is how do I deal with the folders in the root of the domain in regards to cPanel... how do I get the url to point to the WWW folder?

    After some more research I have managed to get some of the solution but I'm getting an 400 error on some of the site...

    Any thoughts appreciated.
     

    Attached Files:

  4. Robin Ball

    Robin Ball Registered

    Joined:
    Apr 22, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Website Owner
    Here's the updated .htaccess
    Code:
    RewriteEngine on
     
    # Change yourdomain.com to be your main domain.
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAIN_REMOVEDe$
     
    # Change 'subfolder' to be the folder you will use for your main domain.
    RewriteCond %{REQUEST_URI} !^/www/
    
    # Don't change this line.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
     
    # Change 'subfolder' to be the folder you will use for your main domain.
    RewriteRule ^(.*)$ /www/$1
     
    # Change yourdomain.com to be your main domain again.
    # Change 'subfolder' to be the folder you will use for your main domain
    # followed by / then the main file for your site, index.php, index.html, etc.
     
    RewriteCond %{HTTP_HOST} ^(www.)?DOMAIN_REMOVEDe$
    RewriteRule ^(/)?$ www/index.php [L]
    
     
    #4 Robin Ball, Apr 22, 2018
    Last edited by a moderator: Jun 27, 2018
  5. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    714
    Likes Received:
    120
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    This is a super ugly solution, why are you going at it this way =X

    Anyway, the problem is with the path to your actual content, if you go to the site, you will see all 404's for all content, example:

    http://example.com/wp-content/uploads/2016/07/Laser-Hair-removal-Dublin.jpg

    where as the correct path is:

    http://example.com/www/wp-content/uploads/2016/07/Laser-Hair-removal-Dublin.jpg

    So you have to use

    Giving WordPress Its Own Directory « WordPress Codex

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    RewriteCond %{REQUEST_URI} !^/www/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /www/$1
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    RewriteRule ^(/)?$ www/index.php [L]
    </IfModule>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 Jcats, Apr 22, 2018
    Last edited by a moderator: Apr 22, 2018
    Robin Ball likes this.
  6. Robin Ball

    Robin Ball Registered

    Joined:
    Apr 22, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ireland
    cPanel Access Level:
    Website Owner
    That's sorted it. Thanks a million jcats
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice