D
D
Dmitry2017-07-03 18:04:02
htaccess
Dmitry, 2017-07-03 18:04:02

htaccess hide folder from url?

Actually there is a project with a brif folder. It contains a lot of files, including styles, pictures.
So the task is to hide this edit through htaccess + remove the php extension.
I removed the extension and even got a page, but without styles. My brain is already boiling, I've been conjuring over this shit for 3 hours
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^.*$ $0.php [L,QSA]
RewriteCond %{THE_REQUEST} ([^\s]*)\.php(\?[^\s]*)?
RewriteRule (.*) %1 [R=301,L]
#RewriteRule ^uiux$ brief/uiux.php
PS: root is also needed, other files are there :facepalm:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-07-11
@shambler81

<IfModule mod_mime.c>
        <Files ~ \.(php|php3|php4|php5|php6|phtml|pl|asp|aspx|cgi|dll|exe|shtm|shtml|fcg|fcgi|fpl|asmx|pht|py|psp|rb|var)>
                SetHandler text/plain
                ForceType text/plain
        </Files>
</IfModule>
<IfModule mod_php5.c>
        php_flag engine off
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question