Answer the question
In order to leave comments, you need to log in
How to remove extra directories from url???
Greetings! I need your help.
There is site.ru at the root there is a wer folder, there are several more folders in it, and in these folders in each one index.html file
, you get the following address site.ru/wer/fer/index.html
site.ru/wer/fer3/ index.html
site.ru/wer/fer2/index.html
how to make it open at this address site.ru/fer/
Answer the question
In order to leave comments, you need to log in
I would like a good example? on my example that I described! if possible, I try it myself, nothing comes out
.htaccess
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?uri=$1 [L]
<?php
...
$uri = explode('/', $_REQUEST['uri']);
if ( $uri[0] == 'fer' )
{
print file_get_contents('wer/fer/index.html');
}
...
This is how it should help.
RewriteEngine On
RewriteRule ^wer/(.*)$ /$1 [QSA, L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question