Use 301 in friendly url

0

A query I want to make my friendly URL through htaccess

My query: It is necessary to redirect with 301 as seen in the first 2 lines (RewriteCond) and (RewriteRule) of the code. In any case when it is better to use it.

Options -MultiViews
RewriteEngine On

# redirect "/pagina.php?id=xxx" to "/pagina/xxx"
RewriteCond %{THE_REQUEST} \s/pagina\.php\?id=([0-9]+)\s [NC]
RewriteRule ^ /pagina/%1? [R=301,L]

# internally rewrite "/pagina/xxx" to "/pagina.php?id=xxx"
RewriteRule ^pagina/([0-9]+)$ /pagina.php?id=$1 [L]

I look forward to the help of any professional. Thanks.

    
asked by juan pablo 29.12.2018 в 19:07
source

0 answers