Good evening.
How is such a way done, such as here - http://habrahabr.ru/blogs/?
those. no blogs.php file is specified
Good evening.
How is such a way done, such as here - http://habrahabr.ru/blogs/?
those. no blogs.php file is specified
Well, there is just some index.php
, in the blogs
folder. The name index.php
can be defined, for example, in the htaccess directive DirectoryIndex
.
In addition, you can always use aliases using the RewriteRule:
RewriteRule ^название_в_адресной_строке$ /ссылка [L]
Then by going to ws.ru/название_в_адресной_строке
you will get what the page /ссылка
produces, and by adding a slash, you will get 404, because this directory may not be.
If I, of course, correctly understood the question.
This is called VRU (human understandable URL), here is my solution to this problem:
1.Go: address of yours.ru / mod / news / post
2.Watch how beautiful everything turned out.
.htaccess file
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)$ index.php/$1 [QSA]
file: index.php
// разбираем строку запроса, и формируем массив $array_url = explode("/", $_SERVER['REQUEST_URI']); foreach($array_url as $value_url) { if(!empty($value_url)) { $SEF[] = trim(urldecode($value_url)); } } // просмотр массива echo '<pre>'.var_export($SEF).'</pre>';
Source: https://ru.stackoverflow.com/questions/73309/
All Articles