N
N
nmods882019-02-10 21:53:27
URL Handling
nmods88, 2019-02-10 21:53:27

Duplicate page by link with get parameters?

Hello!
There is a link mysite.ru/cat is on the site, I fasten get parameters to it in htaccess
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} ^/[a-zA-Z_-]+$
RewriteRule ^(.*)$ ?pageGet=$1 [L]
This is ok. The problem is that the page mysite.ru/cat is duplicated by mysite.ru/?pageGet=cat
Tried like this
RewriteCond %{REQUEST_URI} ^/\?pageGet=[a-zA-Z_-]+$
RewriteRule ^$ /cat? [L,R=301]
doesn't help. Redirecting mysite.ru/?pageGet=cat to 404, cuts off mysite.ru/cat
Help me figure it out.

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