Actually I need to do this as well (convert site to https). Using Modx Revo 2.5.7-pl. Ive broken my site my editing my .htaccess files in trying to implement cute url's but generally got it back. However, now Modx gives me a warning that my core directory is available for anyone to view: which I presume is undesireable. If I disable the .htaccess file, then I cannot load the Modx manager. It should permit control by the Apache Server and is thus unecessary. However if I enable it, it seems to give everyone access to my core directory. The contents of the .htaccess are as below. Note I've change my domain to my-domain. Finally I was preferring to use [u]my-domain.com[/u] NOT www.my-domain.com You'll note there are differences between the .htaccess file referenced elsewhere in some of the coding for example he has: code]#RewriteCond %{HTTP_HOST} !^clientdomain\.com [NC]
RewriteCond %{HTTP_HOST} ^(www.)?my-domain.com$
# .htaccess main domain to subfolder redirect # Copy and paste the following code into the .htaccess file # in the public_html folder of your hosting account # make the changes to the file according to the instructions. # Do not change this line. RewriteEngine on # Change yourdomain.com to be your main domain. RewriteCond %{HTTP_HOST} ^(www.)?my-domain.com$ # Change 'subfolder' to be the folder you will use for your main domain. RewriteCond %{REQUEST_URI} !^/modx/ # 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 ^(.*)$ /modx/$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.)?my-domain.com$ RewriteRule ^(/)?$ modx/index.php [L] ErrorDocument 404 "<H1>Page 404 not finding</H1>"
# Prevent Apache from serving .htaccess files: <FilesMatch "^\.htaccess"> Order allow,deny Deny from all </FilesMatch> Options All -Indexes Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} domain\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://domain.com/$1 [R,L] # The Friendly URLs part RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
Hi here is mine, my hoster recently helped me fix it, it writes everything to https. Also you absolutely need this file or I don't think you can serve any pages at all
Hi
Yes cancel the www, I dont know why but I did apparently its the trend