Answer the question
In order to leave comments, you need to log in
How to hide file extension and folder in url?
how to hide file extension and folder in browser address bar
example:
site.ru/directory/file.php change to site.ru/file ?
now the htaccess file looks like this:
RewriteRule .* index.php [L]
RewriteCond %{REQUEST_URI} ^/directory/.*$
RewriteRule ^directory/(.+)$ site.ru/$1 [L,NC]
tried to prescribe below:
RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^.]+)\.phpl\ HTTP
RewriteRule ^([^.]+)\.php$ site.ru/$1 [L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteRule (.*) /$1.html [L]
will eventually only work if the condition
RewriteRule ^directory/(.+)$ site.ru/$1 [ L,NC] - absent
those. I managed to hide either the folder or the extension, but I can’t convert everything together ... what are the options?
Answer the question
In order to leave comments, you need to log in
the task is a little not clear, vsmysle to hide the extension and the folder?
folder in the format ? .php folder or where?
For exceptions, you can use
т такие замечатлеьные штуки
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question