User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,624 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,187 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1308 | Replies: 7
Reply
Join Date: Jul 2004
Posts: 36
Reputation: Ashley is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ashley Ashley is offline Offline
Light Poster

PHP index question

  #1  
Dec 18th, 2005
I'm kind of new to PHP. I wanted to know how to get my site to open in it's original url ie: http://blah4site.com/name instead of http://blah4site.com/name/index.php or having a slpash page and then going into the http://blah4site.com/name/index.php, when someone first visits the site. I hope this isn't too confusing. Here is an example site: click See how her's opens to the original url and then if you hover over 'main' it takes you to http://www.lunaestas.com/savvy/index.php. So this must happen somewhere within the php file? How do I do this?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 194
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
PoA PoA is offline Offline
Junior Poster

Re: PHP index question

  #2  
Dec 18th, 2005
Try to put it in .htaccess file.
Redirect /name/index.php http://blah4site.com/name
It's not tested yet. Please let me know the results.
Reply With Quote  
Join Date: Jul 2004
Posts: 36
Reputation: Ashley is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ashley Ashley is offline Offline
Light Poster

Re: PHP index question

  #3  
Dec 18th, 2005
Put what in the .htaccess?
Reply With Quote  
Join Date: Jul 2004
Posts: 194
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
PoA PoA is offline Offline
Junior Poster

Re: PHP index question

  #4  
Dec 18th, 2005
Sorry did not make clear. Put the below code in .htaccess
Redirect /name/index.php http://blah4site.com/name
Reply With Quote  
Join Date: Jul 2004
Posts: 36
Reputation: Ashley is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ashley Ashley is offline Offline
Light Poster

Re: PHP index question

  #5  
Dec 19th, 2005
I tried it this way Redirect /name/ http://blah4site.com/name/index.php and I got redirection URL has exceeded its limit and said it may be caused by cookies that are being blocked. Nothing happened with the code the other way.
Reply With Quote  
Join Date: Jul 2004
Posts: 194
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
PoA PoA is offline Offline
Junior Poster

Re: PHP index question

  #6  
Dec 19th, 2005
Try alternative code.

put the below code in top of index.php
[PHP]if($_SERVER['REQUEST_URI'] == "/name/index.php"){
header("Location: http://blah4site.com/name/");
}[/PHP]
Reply With Quote  
Join Date: Jul 2004
Posts: 36
Reputation: Ashley is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ashley Ashley is offline Offline
Light Poster

Re: PHP index question

  #7  
Dec 19th, 2005
nope, didn't do anything.
Reply With Quote  
Join Date: Jul 2004
Posts: 36
Reputation: Ashley is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Ashley Ashley is offline Offline
Light Poster

Re: PHP index question

  #8  
Dec 19th, 2005
I found how to do it. Thanks for all your help!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC