I have the following file structure in cPanel
web_root_folder_
|____.neverDelete/_____
| |_____img/logo-30.png
| |_____js/error-page.js
| |_____css/error-page.css
|
|____403.shtml
|
|____.htaccess
I wanted to write .htaccess
with some code that puts the website in 'maintenance mode'.
So...I wrote 403.shtml
page, which uses external css, javascript and images stored in .neverDelete
folder.
I wrote the following code in .htaccess
# The WORKING CODE (Too Long ??)
Deny From All
<FilesMatch 404-layout.min.css>
Allow From All
</FilesMatch>
<FilesMatch logo-small-transparent-30.png>
Allow From All
</FilesMatch>
<FilesMatch error-page.js>
Allow From All
</FilesMatch>
This code successfully worked. It implemented a 403(forbidden)
for all files except the 3 files (mentioned in .htaccess
file)
but, I want to make all the files n folders present in .neverDelete/
to be served on my website when in maintenance mode.
So i visited http://httpd.apache.org/docs/1.3/mod/core.html#directory to get help. I wrote the code in .htaccess
below that actually gave in a 500(server error)
.
# WRONG CODE
Deny From All
<Directory .neverDelete/ >
Allow From All
</Directory>
How can I make all the files n folders present in .neverDelete/
to be served on my website when in maintenance mode
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…