Running Concrete5 version 7 or 8 from a subdirectory?
Permalink
Hi,
I have installed Concrete5 into a subdirectory (/cms2) on my apache web host with PHP 7. I have also setup my .htaccess file to rewrite urls to /. My .htaccess file is here:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cms2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
If I remove the subdirectory from any address (except the root index file [meaning /cms2/index.php]) the site works fine. However, If I try to remove the /cms2/ from the rott index.php file or enter the web address my.domain.com the rewrite does not occur. It reverts to / and presents me with a file list on my web host.
I've read over a few posts talking about insert some PHP code in the index.php file, and a few .htaccess options
https://www.concrete5.org/community/forums/installation/hide-the-sub...
https://www.concrete5.org/community/forums/installation/hide-the-sub...
This is the one I want to make work:
https://www.concrete5.org/community/forums/installation/redirect-iss...
I don't know if I am being dense today or not. For those of you who have C5 working in a Subdirectory how did you ultimately get it to redirect every request to the subdirectory without showing it to the end user?
(I'd love to make this a .htaccess file edit rather than modifying code that would have to be updated with each C5 update :) )
I am currently running with Pretty URLS on and Cache off and empty
thanks
I have installed Concrete5 into a subdirectory (/cms2) on my apache web host with PHP 7. I have also setup my .htaccess file to rewrite urls to /. My .htaccess file is here:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cms2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
If I remove the subdirectory from any address (except the root index file [meaning /cms2/index.php]) the site works fine. However, If I try to remove the /cms2/ from the rott index.php file or enter the web address my.domain.com the rewrite does not occur. It reverts to / and presents me with a file list on my web host.
I've read over a few posts talking about insert some PHP code in the index.php file, and a few .htaccess options
https://www.concrete5.org/community/forums/installation/hide-the-sub...
https://www.concrete5.org/community/forums/installation/hide-the-sub...
This is the one I want to make work:
https://www.concrete5.org/community/forums/installation/redirect-iss...
I don't know if I am being dense today or not. For those of you who have C5 working in a Subdirectory how did you ultimately get it to redirect every request to the subdirectory without showing it to the end user?
(I'd love to make this a .htaccess file edit rather than modifying code that would have to be updated with each C5 update :) )
I am currently running with Pretty URLS on and Cache off and empty
thanks
When I type "my.domain.com/mypage" my browsers will take me there... to the full length address: "my.domain.com/cms2/mypage"
Thanks