301 redirect partialy working. need help
i'm using the standard redirection which works partialy.
it does redirect to the new page, but in the browser it keeps the old url as if it's still on my website. i would like instead to show the new url so the user will go next time directly to the new page and not the old o开发者_JAVA百科ne.
so, if i type in the old-url.php the server would redirect to new-url.php, but in the browser user can see the old-url.php. i would like the browser to show the new-url.php
should i use php to redirect the browser to the new url?
note, i'm not using any databases, so i can only do this through htaccess and php
i wouldn't like though to use php as the files from which i'm redirected are deleted from my server and creating them just for redirection, would make a mess on my website.
i'd like to stick to htaccess
Type a full path in your .htaccess eg...
RewriteRule ^old/address http://www.example.com/new/address [R=301]
Based on your .htaccess..
RewriteRule ^old.php http://website.org/directory/new.php [R=301,L]
Did you try this in PHP?
<?php
header('Location: http://www.example.com/');
?>
精彩评论