I have configured in .htaccess CNC

RewriteEngine on RewriteRule ^ofise/([A-Za-z0-9-]+)$ ofise.php?p=$1 [L] 

When you go to http://site.ru/ofise/nameofis, we get to http://site.ru/ofise/ofise.php?p=nameofis and everything works

How to change the regular season so that you can take additional GET per line or at least one? So what would http://site.ru/ofise/nameofis?param=yes and http://site.ru/ofise/nameofis/?param=yes work

  • @sayusha, m. did you mean comprehensible? "Humanlike" sounds scary. - stck
  • @stck Yes, I didn’t even think about what I wrote :) - user9116

2 answers 2

The question is almost solved. It is necessary instead of [L] to write [QSA, L]

 RewriteRule ^ofise/([A-Za-z0-9-]+)$ ofise.php?p=$1 [QSA,L] RewriteRule ^ofise/([A-Za-z0-9-]+)/$ ofise.php?p=$1 [QSA,L] 

The problem now is that the address http://site.ru/ofise/nameofis is OK, and styles are not loaded by http://site.ru/ofise/nameofis/ , and the pictures work fine

  • one
    Problem solved by adding absolute path - user9116

For external styles, js files, images, etc. make addresses relative to the server, for example - / images / img.png, and not relative to the folder, because the browser treats the converted URLs as separate folders ...