T
T
tostik2014-09-15 00:34:50
PHP
tostik, 2014-09-15 00:34:50

How to change url type?

Hello, please tell me how to do the following.
The site has an existing page like: "site/nazvanie_categorii".
It is necessary that in the address bar when typing "site/nazvanie-categorii" the page "site/nazvanie_categorii" is shown, while the page "site/nazvanie-categorii" remains in the address bar of the browser.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HaveFun, 2014-09-16
@HaveFun

mod_rewrite is used to redirect to another address or include a specific file. For example, if it is known that the /nazvanie_categorii/index.php file is responsible for generating the page, then it is enough to add to .htaccess

RewriteRule /nazvanie-categorii /nazvanie_categorii/index.php

If the application uses a CMS or a framework, then, as a rule, the index.php file is included from the root directory and the question goes to the CMS/framework routing plane.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question