Reputation: 6814
I need to redirect a page like www.someone.com/2011/03/05 to sample.php?dt=2011/03/05 using htaccess and php, Thanks.
Upvotes: 0
Views: 342
Reputation: 2251
You can use mod_rewrite if you have an Apache webserver and define the rules in your .htaccess.
See for example: http://corz.org/serv/tricks/htaccess2.php
Upvotes: 0
Reputation: 152294
RewriteEngine on
RewriteRule ^(\d{4}\/\d{2}\/\d{2})/?$ sample.php?dt=$1 [L]
Upvotes: 2
Reputation: 181460
If you have PHP you don't need .htaccess
:
Just place this on your PHP file:
<?php
header("Location: http://www.someone.com/2011/03/05");
?>
Upvotes: 0