Robin Ball

Registered
Apr 22, 2018
4
0
1
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.
 

Attachments

Robin Ball

Registered
Apr 22, 2018
4
0
1
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.
 

Attachments

Robin Ball

Registered
Apr 22, 2018
4
0
1
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]
 
Last edited by a moderator:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
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>
 
Last edited by a moderator:
  • Like
Reactions: Robin Ball