Domanda

I want to do a 301 redirect from old_page.php to new_page.php and keep all query strings if they exist.

so old_page.php would redirect to new_page.php

old_page.php?test=1 would redirect to new_page.php?test=1

Here is what I have below, but it's a 404 error.

RewriteEngine on 
RewriteRule ^old_page.php(.*) new_page.php$1 [R=301,L]
È stato utile?

Soluzione

This worked:

Redirect 301 /old_page.php /new_page.php
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top