문제

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]
도움이 되었습니까?

해결책

This worked:

Redirect 301 /old_page.php /new_page.php
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top