PHP wildcard redirection script?
So I just moved my site from /blog to / (root) directory. Now for those
people who know previous /blog URL, I want to redirect them to new URL
(/).
So I have put this index.php file in /blog dir:
<?php
header( 'Location: http://www.abc.com' ) ;
?>
and it works. But I want this: When a user visits any blog post from old
url like http://abc.com/blog/sample-post then instead of redirecting to
abc. com, it should redirect to abc. com/sample-post
I think it may also be done by .htaccess redirection but I dont know
htaccess method.
Please give me code for this :)
No comments:
Post a Comment