DxDogo
DxDogo

Reputation: 71

Google result redirect url

I updated my site by removing some unnecessary paths from the url. Is it possible to redirect people accessing the old url directly to the new one?

Old: https://example.com/board/index.php?/topic414 New: https://example.com/topic414

Some people have old links, google also has old links indexed. As a temp fix I have made an index page in /board that redirects all old links to the new homepage. Otherwise it would be just a white screen.

Upvotes: 1

Views: 246

Answers (1)

anubhava
anubhava

Reputation: 786091

You can use this rule as your very first rule in site root .htaccess:

RewriteEngine On

RewriteCond %{THE_REQUEST} /board/index\.php\?(/\S+)\s [NC]
RewriteRule ^ %1 [L,NE,R=301]

Upvotes: 1

Related Questions