user1373161
user1373161

Reputation:

How to create external redirect for below internal redirect using .htaccess

i have this rule in .htaccess file which is internal redirect can anybody tell me how to make this external redirect using R301

#Internal Rewrite#
RewriteRule ^(.*)page/([^/\.]+)/?$ $1?page=$2 [L]

I want to make it something like below [but it is not working something is wrong here..]

RewriteCond %{THE_REQUEST} \?page=([0-9]+).*
RewriteRule (.*) $1/page/%1? [R=301,L]
RewriteRule (.*)/page/1 $1 [R=301,L]

Any expert here can help me..Thank you in avance.

Upvotes: 1

Views: 356

Answers (1)

anubhava
anubhava

Reputation: 784998

Add R=301 flag like this:

RewriteRule ^(.*)page/([^/.]+)/?$ $1?page=$2 [L,R=301,QSA,NC]

Upvotes: 1

Related Questions