S
S
Sergey2016-01-19 13:26:41
PHP
Sergey, 2016-01-19 13:26:41

Correct .htaccess?

There are various spellings of the single entry point. Could you write me the correct .htaccess with explanations why this is so.
RewriteEngine On
RewriteBase /
add X-Frame-Options: DENY vs. iframe
Options All -Indexes
deny access to all files except ( prohibit .htaccess itself too ): robots.txt in the root , files in folders in the root of the site, several JS folders , CSS, OG, and index.php itself
Create a single entry point to index.php
Redirect from http:/domain.com to http:/www.domain.com
That's what I got, above I highlighted what I didn't implement

RewriteEngine On
RewriteBase /
Header set X-Frame-Options DENY
Options All -Indexes
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^JS/(.*)$ JS/$1 [L]
RewriteRule ^CSS/(.*)$ CSS/$1 [L]
RewriteRule ^OG/(.*)$ OG/$1 [L]
RewriteRule ^.*$ [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteCond %{HTTP_HOST} ^teamspeak.wiki
RewriteRule (.*) http://www.teamspeak.wiki/$1 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2016-01-20
@chelovekmuravei

Here is a single entry point for you: https://github.com/nazar-pc/CleverStyle-CMS/blob/m...
In addition, for which rewrite is turned off, everything is fed to index.php ( <Files *.php>in production it also needs to be removed).
About X-Frame-Options: https://github.com/nazar-pc/CleverStyle-CMS/blob/m...
Adds X-Frame-Options to directories where user files can be + forces the browser to download files on direct access, because any files can be uploaded, this avoids problems when the user uploads an HTML file with arbitrary JS - the page will not open, but the file will start downloading.
And more: https://github.com/nazar-pc/CleverStyle-CMS/blob/m...
The level above disables the processing of any files by the interpreter - allows you not to be afraid if the user uploads a PHP file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question