hello, i want to redirect people to mydomain.com/dateoftoday if they come on my website page which doesnt exist so if they if its today 10/29/2012 and they acces a 404 page on my website it must redirect them to mydomain.com/10/29/2012 so they can see all new posts of today if they acces tomorrow (10/30/2012) it must redirect to mydomain.com/10/30/2012 can somebody please help? i have 7$ in my paypal, i can give it to u if u want
You can redirect with .htaccess using ErrorDocument 404 /404.php And then inside 404.php file get the date and redirect again to mydomain.com/10/29/2012. Example code: <?php $curDate = date("m/d/Y"); $url="http://www.mydomain.com/".$curDate; header('Location:'.$url); ?> Let me know if this works.
hello, thnx, that works but it redirects like to : mydomain.com/10/29/12 and i want him to redirect to like: mydomain.com/10/29/12.html how to do this sir?
<?php $curDate = date("m/d/Y"); $url='http://www.mydomain.com/'.$curDate.'.html'; header('Location:'.$url); ?> PHP: