Here's what I'm trying to do. When people type in http://www.mysite.com/enewsletter/ in the URL, the browser will load the index.php page by default. But what I wanted to do is when people type this, http://www.mysite.com/enewsletter/, in the URL I want the browser to load http://www.mysite.com/enewsletter/enews.php?id=1. Can this be done? If yes, mind showing me the steps?
Thanks!
How to redirect index page?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Many thanks for your help. Yes, I think I'm using an Apache but I'm not the web server administrator. Any I found that this:
works on my case.
Code: Select all
if (!isset($_GET['id'])) {
header ("Location: index.php?id=1");
}works on my case.