Hello! Tell me, please, is it possible to alter these URL scripts on the site?

http://www.site.com/inner.php?razdel=company&razdel_title= For customers&id=2

in some such, for example:

http://www.site.com/inner.php/company/ For customers/2

That is, the second option is displayed in the address bar, and processed in the script as the first.

    2 answers 2

    .htaccess code

    RewriteEngine On RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /inner.php?razdel=$1&razdel_title=$2&id=$3 [L] 

    or

     RewriteEngine On RewriteRule ^inner\.php\/([^/]*)/([^/]*)/([^/]*)$ /inner.php?razdel=$1&razdel_title=$2&id=$3 [L] 

    He wrote "on the knee", there is nowhere to check :(

    • Thank! I will try now. - masha2
    • Something does not work. Began to try a little on others. URL, really. .htaccess turned out to be like this: AddDefaultCharset utf-8 RewriteEngine on RewriteRule ^ ([^ /] *) / ([^ /] *) $ /inner.php?t=$1&url=$2 [L] With it, it tried to convert the URL .ru / inner.php / o_kompanii / About the company in site.ru/inner.php?t=o_kompanii&url=About the company It seems that there is no conversion, no parameters are seen at all. - masha2
    • No, the conversion still happens. For example, the css file stopped connecting (<link rel = "stylesheet" href = "style / index.css">), inner.php - masha2 is also connected instead
    • try href = "/ style / index.css" - nolka
    • nolka, thank you very much for your help! - masha2

    Go to this link , specify the original URL, adjust the parameters and the output, get the rule. Similar actions can be done on this resource.

    • Everything worked, thanks, the generators helped a lot. - masha2