Hey , I have simple ( I think ) question about redierction. Lets say I have domain xxx.com . Now I have dir on it lets say xxx.com/blog/ Now I want every page (even if not exist) will redierct to xxx.com Example : if someone will type xxx.com/blog/xyxy.html he will be rediercted to xxx.com. I think the soultion may come with .htaccess file but I am not sure how. Kindly help Thank you.
you can put this on your .htaccess file: ErrorDocument 404 / and every error will show the homepage, but the address bar wont change (xxx.com/blog/xyxy.html) if you need to show only the xxx.com add this: ErrorDocument 404 /404.php and put this on the 404.php file: <?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://xxx.com"); ?> PHP:
if you would like to just throw in a file in each folder that does not currently have content you can put in a meta re-direct like this... <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yoursite.com">