Jump to content

Setting up a page, blog, etc as the default


tsincaat
 Share

Recommended Posts

Lets say I'm making a blog. I want my website (www.example.com) when entered into a web browser to go straight to my blog. Do I have to install the blog in my default site directory (Not in its own folder), or is there a way I can automatically send people entering my URL to the blog's directory (www.example.com/blog)?

Link to comment
Share on other sites

You can redirect through HTML, JavaScript or server-side with code in your index file

<!-- PHP --><?php	header("location:blog/");?><!-- HTTP-equivalent --><meta http-equiv="refresh" content="0; blog/" /><!-- JavaScript --><script type="text/javascript">	window.location = "blog/";</script>

But if there is nothing else on the site, why not put it in the web root?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...