Octobercms .htaccess Structure
I need help with october cms .htaccess file. In my root, besides my website folders and files I have a folder which contains websites for some projects, 4 of them.
In my actual octobercms website i want to have 4 links to each website.
projects/project-A
projects/project-B
projects/project-C
projects/project-D
What must I do in my .htaccess file so I can open each website?
Thank you!
Answer
I assume that projects
folder is in root
folder where you OctoberCMS resides, in short, where index.php
and .htaccess
file is.
Then you need to tell apache
do not rewrite all request to index.php
file when it sees projects
in the begging of URL
add a rule to .htaccess
file
##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
....
Just add one more entry here like
RewriteCond %{REQUEST_FILENAME} !/projects/*
It will allow you to server file from projects
now and you can surf site from these folders.
The link will be like https://october-plaza.com/projects/index.html
etc
I do not know much about .htaccess
but I whitelist folders like this so I can access files from it
if any doubts please comment.
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?