Ad

Octobercms .htaccess Structure

- 1 answer

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-Aprojects/project-Bprojects/project-Cprojects/project-D

What must I do in my .htaccess file so I can open each website?

Thank you!

Ad

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.

Ad
source: stackoverflow.com
Ad