N
N
noname902015-11-14 15:40:04
Apache HTTP Server
noname90, 2015-11-14 15:40:04

How to disable adding GET parameters on 301 redirects?

When redirecting, the url takes the following form: les.local/book/Sergeyj_Bogomazov_OBEKT-12?book=Ser... .
When the RewriteRule is removed, the parameters are no longer passed, but the RewriteRule is needed.
.htaccess

Options All -Indexes
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^page([^/]*)$ /index.php?page=$1 [L]
RewriteRule ^category/([^/]*)$ /index.php?category=$1 [L]
RewriteRule ^category/([^/]*)/page([^/]*)$ /index.php?category=$1&page=$2 [L]
RewriteRule ^book/([^/]*)$ /index.php?book=$1 [L]
RewriteRule ^author/([^/]*)$ /index.php?author=$1 [L]
RewriteRule ^author/([^/]*)/page([^/]*)$ /index.php?author=$1&page=$2 [L]
RewriteRule ^voice/([^/]*)$ /index.php?voice=$1 [L]
RewriteRule ^voice/([^/]*)/page([^/]*)$ /index.php?voice=$1&page=$2 [L]
RewriteRule ^publisher/([^/]*)$ /index.php?publisher=$1 [L]
RewriteRule ^publisher/([^/]*)/page([^/]*)$ /index.php?publisher=$1&page=$2 [L]
RewriteRule ^year/([^/]*)$ /index.php?year=$1 [L]
RewriteRule ^year/([^/]*)/page([^/]*)$ /index.php?year=$1&page=$2 [L]
redirect 301 /book/Sergeyj_Bogomazov_Obekt-12 http://les.local/book/Sergeyj_Bogomazov_OBEKT-12

How to make redirect and RewriteRule work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question