1

Get:

https://xxx.ru/page/?page=update-1/

how to show:

https://xxx.ru/page/update-1/

I tried does not work .htaccess

RewriteBase /
RewriteEngine on

RewriteRule ^page\/(.*?)/?$ page/?page=$1 [L,QSA]
Sauron
  • 143
  • 2
  • 6
  • Possible duplicate of [URL rewriting with PHP](http://stackoverflow.com/questions/16388959/url-rewriting-with-php) – mmgross Jul 04 '16 at 21:00

2 Answers2

1

Use this:

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

It will give you the following URL:

https://xxx.ru/page/update-1/

Joe
  • 4,877
  • 5
  • 30
  • 51
1

You can use:

RewriteEngine on
RewriteBase /

# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} \s/+page/\?page=([^\s&]+) [NC]
RewriteRule ^ /page/%1? [R=302,L,NE]

# internal forward from pretty URL to actual one
RewriteRule ^page/(.+)$ page/?page=$1 [L,QSA,NC]
Croises
  • 18,570
  • 4
  • 30
  • 47