Without using htaccess, my URL looks like this: http://site.ru/index.php?page=1 .

How with the help of htaccess, to make of this, this option: http://site.ru/1 ?

    2 answers 2

    taken from comment.


     RewriteRule ^/?(\d+)$ index.php?page=$1 [L] 
    • I did it, but it does not work for me - arseniy mironov

    Like this:

     RewriteEngine On RewriteRule ^([^/]*)$ /index.php?page=$1 [L] 

    or so

     Options +FollowSymLinks RewriteEngine on RewriteRule (.*)/$ /index.php?page=$1 

    PS I am writing to the memory, but it seems to work.

    • If I am not mistaken, then both options will lead to cyclic redirection. - ReinRaus 5:56 pm
    • void. Unfortunately your option does not work. :-( - StasHappy
    • one
      . RewriteRule ^ /? (\ D +) $ index.php? Page = $ 1 [L] - ReinRaus
    • ReinRaus. Thank you! The option is working. - StasHappy pm
    • I apologize that I could not fix it - I just got to the computer. Yes, my option is not what I was going to write similar to the correct one, which @ReinRaus has already indicated, but already ahead)) - void