This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello, I would like to know how I add a custom folder inside the october cms structure. In that custom folder I have an old website running. In my webserver I create for example I create a folder test with an index.html in it. When I try to open my website through /test/index.html October tells me "Page not found". I know that I can add routes in Laravel, but I don't know exactlly where I can add the route, so that is opens my test folder. Is it possible to run this folder with its php and html files as standalone folder/website and let October only redirect to it?
Route::get('/test', function() {
return File::get(public_path() . '/test/index.html');
});
Another way to manage this would be, to install october in a subdirectory and to put the index.php in the parent directory, so I can put my custom stuff in the main directory of the webserver and have the october installation in a subfolder called /oct... problem after I change the paths in the index.php it does not load everything inside the installation, the css in the backend is missing complete and so on. Perhaps someone can tell me which paths I should change, when I put my index.php one folder above. Thank You!
Better put your October installation and the old site in dedicated directories. Handle the routing stuff on the webserver level (.htaccess/nginx.conf).
You could even create a subdomain for your old page, like old.example.org
and map that domain to the specific folder you old files lay in. Then you can set the docroot of the main domain to the october dir.
I would think the easiest way to accomplish this would be to just add an exception in your .htaccess file above this line: RewriteRule ^ index.php [L,NC]
Something like this would do the trick: RewriteCond %{REQUEST_URI} !test/.*
You could accomplish the same thing in a nginx location block. This will take Laravel out of the picture, thus ignoring it's routing and serving the content in that directory without interruption
Last updated
Thank you for your answers! And it is not possible to have a standalone folder inside the october cms directory? That would be the easiest way and would fit on each webhoster.
Thank you!
marmelflo8253 said:
Thank you for your answers! And it is not possible to have a standalone folder inside the october cms directory? That would be the easiest way and would fit on each webhoster.
Thank you!
This is exactly what my above answer does via your .htaccess
file.
You can use one of the whitelisted folders for this. I use storage/app/uploads/_myfolder
1-7 of 7