Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 7th, 2003, 04:21 AM
tiny12 tiny12 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 135 tiny12 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
redirect index.html to index.php, how to do this in apache

redirect index.html to index.php, how to do this in apach?


whenever it hits index.html it will redirect to index.php.


can u show me in apache?

Reply With Quote
  #2  
Old May 7th, 2003, 10:21 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,295 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 36 m 24 sec
Reputation Power: 760
Do you need to redirect any .html file to the corresponding .php file? or are you trying to have Apache show a php page when you don't specify one (i.e., http://domain.com/ would load index.php).

Instead of redirecting, you may get the result you're looking for by adding index.php to the DirectoryIndex directive in your httpd.conf file.

Reply With Quote
  #3  
Old May 7th, 2003, 01:49 PM
Eclipce Eclipce is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2000
Posts: 763 Eclipce User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 5 h 29 m 25 sec
Reputation Power: 0
Ok, aside from the bad english, which I know can be a hard laguage to learn. (Most Americans dont speek proper english :P)

This post should have been posted in the Apache forum. You would get a faster and better response if it were in that forum.

Eclipce

Reply With Quote
  #4  
Old May 7th, 2003, 03:12 PM
tiny12 tiny12 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 135 tiny12 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
whenever index.html is hit , it will re-direct to index.php.


my poor english is OK.

Reply With Quote
  #5  
Old May 7th, 2003, 06:46 PM
mttatkns mttatkns is offline
Got source?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Laguna Niguel, California, USA
Posts: 2,332 mttatkns User rank is Private First Class (20 - 50 Reputation Level)mttatkns User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
If for a specific page:
<meta http-equiv="refresh" content="0;URL=index.php">
If for all, look for DirectoryIndex and add index.php to the list.

Last edited by mttatkns : May 7th, 2003 at 06:48 PM.

Reply With Quote
  #6  
Old May 9th, 2003, 09:40 AM
macgruder's Avatar
macgruder macgruder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Japan
Posts: 251 macgruder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 54 sec
Reputation Power: 8
Question

Quote:
Originally posted by tiny12
whenever index.html is hit , it will re-direct to index.php.



I'm wondering why you want a redirect rather than modifying your httpd.inc

Reply With Quote
  #7  
Old May 9th, 2003, 12:14 PM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
You don't want a redirect. You want a "Rewrite rule". Post this question in the Apache forum and ask how to do this with mod_rewrite.
__________________
The real n-tier system:

FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

Amazon wishlist -- rycamor (at) gmail.com

Reply With Quote
  #8  
Old May 9th, 2003, 01:25 PM
jpenn's Avatar
jpenn jpenn is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2002
Location: Washington, DC
Posts: 2,693 jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 41 m 10 sec
Reputation Power: 16
Code:
RewriteEngine On
RewriteRule ^index\.html$ /index.php [L]

Drop that in a .htaccess file and put in directory. Should work...
__________________
~ Joe Penn

Reply With Quote
  #9  
Old May 9th, 2003, 07:15 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,295 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 1 h 36 m 24 sec
Reputation Power: 760
I'm still trying to figure out why we can't just change the DirectoryIndex ???
Code:
# .htaccess
DirectoryIndex index.php

Reply With Quote
  #10  
Old May 9th, 2003, 07:35 PM
mttatkns mttatkns is offline
Got source?
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Laguna Niguel, California, USA
Posts: 2,332 mttatkns User rank is Private First Class (20 - 50 Reputation Level)mttatkns User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Quote:
I'm still trying to figure out why we can't just change the DirectoryIndex ???
Beats me

Reply With Quote
  #11  
Old May 9th, 2003, 08:17 PM
jpenn's Avatar
jpenn jpenn is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2002
Location: Washington, DC
Posts: 2,693 jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 41 m 10 sec
Reputation Power: 16
Not sure - he said he wanted a re-direct, so thats what I gave him (I think)

Reply With Quote
  #12  
Old May 9th, 2003, 08:26 PM
macgruder's Avatar
macgruder macgruder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Japan
Posts: 251 macgruder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 54 sec
Reputation Power: 8
Question just wondering

will that rewrite work if we go to a directory

http://somedomain.com/

Will that take us to index.html, and then redirect to index.php?

Reply With Quote
  #13  
Old May 9th, 2003, 08:40 PM
jpenn's Avatar
jpenn jpenn is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2002
Location: Washington, DC
Posts: 2,693 jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 41 m 10 sec
Reputation Power: 16
Lets try

Trying
.
.
.
.
.
.
.

YES - it will also hide the page. So, if your site address is this ->

somesite.com

And the request is that, and your index is index.html - using the rewrite you can do this ->
Code:
RewriteEngine On
RewriteRule ^index\.html$ /some_dir/blah/blah/blah/index.php [L]

The request would be sent to somesite.com/some_dir/blah/blah/blah/index.php but would actually show the address as somesite.com...

Reply With Quote
  #14  
Old May 9th, 2003, 09:21 PM
SilkySmooth's Avatar
SilkySmooth SilkySmooth is offline
Newbie :P
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2001
Location: In the PHP Engine :-)
Posts: 2,880 SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 11 h 32 m 23 sec
Reputation Power: 15
Quote:
Originally posted by tiny12
my poor english is OK.


Sorry but that is extremely debatable given your recent thread
__________________
---------------------
-- SilkySmooth --
---------------------
Proxy | Little Directory

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDev Shed Lounge > redirect index.html to index.php, how to do this in apache


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post