A
A
Anton Schultz2020-02-09 17:25:54
htaccess
Anton Schultz, 2020-02-09 17:25:54

How to handle requests for folder names?

There is a folder called handler
How to process a request localhost/handlerso that the folder does not open, but opens the specified page, for example 404.php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2020-02-09
@MrAnderson1999

# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
    Require all denied
</Files>
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
# godaddy hack no input file specified
RewriteRule .* index.php [PT,QSA,L]

with the translation of comments you will figure it out yourself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question