Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

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:
  #1  
Old May 19th, 2002, 10:33 PM
tachyonism tachyonism is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 25 tachyonism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[?] work without showing '.php' extension ?

Hi,
Is it possible to make httpd.conf work without having to add .php as DirectoryIndex or application/x-httpd-php ?

Here is what I'd like to have in visitors browser:
http://www.my.com/script?ses=1234532&name=you
- instead of -
http://www.my.com/script.php?ses=1234532&name=you

TIA
tachyonism

Reply With Quote
  #2  
Old May 20th, 2002, 12:56 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
You can change the DefaultType in httpd.conf. I'm not sure how this will effect mod_php, though.

Reply With Quote
  #3  
Old May 20th, 2002, 03:43 AM
tachyonism tachyonism is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 25 tachyonism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've been looking around, but still I don't get the idea of changing the DefaultType in httpd.conf.

What should I change here ? my default is 'text/plain'.

thanks for your help

Reply With Quote
  #4  
Old May 20th, 2002, 05:24 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,936 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 4 Months 4 h 44 m 13 sec
Reputation Power: 1700
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
If you have access to your htaccess file for a certain directory and change that to point at a php file (called whatever), store it in that directory, then you could have:

http://www.my.com/script/?ses=1234532&name=you with script being the directory as mentioned in the statement above.

Hope this helps / is clear ?
__________________
Cheers,

Jamie

# mdb4u | mobile movie database | Please help to test and promote
# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.



__________________

Reply With Quote
  #5  
Old May 20th, 2002, 05:26 AM
pippo's Avatar
pippo pippo is offline
A PAtCHy sErver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Italy
Posts: 410 pippo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hi,

an alternative choice could be to use apache mod_rewrite module into your httpd.conf:

Code:
RewriteEngine On
RewriteRule ^/script$ /script.php [T=application/x-httpd-php,L]


Doing that every request for

somesite.somewhere/script?etcetc

will be redirected internally ( ie "the browser does not see that" ) to

somesite.somewhere/script.php?etcetc

P.V.

Reply With Quote
  #6  
Old May 20th, 2002, 06:49 AM
tachyonism tachyonism is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 25 tachyonism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your replies.

I use pippo's way, and it works!
thanks again

Reply With Quote
  #7  
Old May 29th, 2002, 02:46 AM
torkil torkil is offline
Another damn newb...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Bodø, Norway
Posts: 94 torkil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Ok... I'm going to hang my balls out there by asking a few n00b questions:

1) I have read about mod_rewrite and many posts by pippo during a mod_rewrite search of this forum. Have I understood it correctly if I say that mod_rewrite is a module of apache that lets you do rule-based URL rewriting? And: The code for mod_rewrite needs to be inserted into some file named httpd.conf?

2) What IS httpd.conf? I guess its got something to do with http and configuration ... well obviously... and that its somehow part of Apache...? I have searched for httpd.conf all over the place, but I can only find material that uses httpd.conf as if the reader knew what it was already. I also read that httpd.conf is the server context configuration, and that .htaccess is directory context configuration. I have no practical experience with apache what so ever, so my background is a bit ... sad?

3) But does this mean that while I have my website in shared hosting at some hosting company, they won't let me edit my httpd.conf? If so: How would I solve this problem then?

I am asking about this because I'm trying (really hard ) to make my website mysite.com/foo/bar work its magic and load mysite.com/index.php?1=foo&2=bar
__________________
Torkil Johnsen

Never underestimate the power of stupid people in large groups...
---------------------------(òÓ,)----

Last edited by torkil : May 29th, 2002 at 02:51 AM.

Reply With Quote
  #8  
Old May 29th, 2002, 03:14 AM
pippo's Avatar
pippo pippo is offline
A PAtCHy sErver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Italy
Posts: 410 pippo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hi,

>> Have I understood it correctly if I say that mod_rewrite is a
>> module of apache that lets you do rule-based URL rewriting?
Yes, these official links could help.
http://httpd.apache.org/docs/mod/mod_rewrite.html
http://httpd.apache.org/docs/misc/rewriteguide.html

>> The code for mod_rewrite needs to be inserted into some file
>> named httpd.conf?
Not necessary, you can put rewrite rules inside .htaccess file too.
Check this link:
http://httpd.apache.org/docs/mod/mo...tml#RewriteRule
and watch the context.

>> What IS httpd.conf? etc etc
Check this official link:
http://httpd.apache.org/docs/configuring.html
I usually put the rewrite rules inside the configuration file httpd.conf,
because I have access to it and for perfomance issues.
BTW, many people have not access to it, but to .htaccess only.

>> But does this mean that while I have my website in shared
>> hosting at some hosting company, they won't let me edit my
>> httpd.conf? If so: How would I solve this problem then?
You can use .htaccess, if your web hosting company let you.
Then you can use rewrite rules inside .htaccess, if your web hosting has mod_rewrite installed.
( Last year I had the last situation, .htaccess but no rewrite rule.
As mr freebsd suggested me I changed my web hosting company.
Now I have a Virtual Private Server where I can edit httpd.conf directly.

>>I'm trying (really hard
Not so really hard

In principle I used rules for redirecting
mysite.com/foo/bar
to
mysite.com/index.php?1=foo&2=bar

actually I prefer to redirect
mysite.com/foo/bar
to
mysite.com/index.php

and then use php $REQUEST_URI enviroment var to handle parameters.

That said, hope this will help!
__________________
My article: mod_rewrite: No More Endless Loops!

Last edited by pippo : May 29th, 2002 at 03:16 AM.

Reply With Quote
  #9  
Old May 29th, 2002, 03:26 AM
torkil torkil is offline
Another damn newb...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Bodø, Norway
Posts: 94 torkil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Okay, maybe not trying too hard. But at least I'm digging for information...

What host do you use btw? How much do you pay for hosting?

What would be the practical difference between doing mod_rewrite in .htaccess and in httpd.conf?

Last edited by torkil : May 29th, 2002 at 03:41 AM.

Reply With Quote
  #10  
Old May 29th, 2002, 03:47 AM
pippo's Avatar
pippo pippo is offline
A PAtCHy sErver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Italy
Posts: 410 pippo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Hi,

we are inside php forum...so please move further apache questions to the apache forum, there you will have better assistance and that is the right place too.

>>What would be the difference between doing mod_rewrite
>> in .htaccess and in httpd.conf?
Shortly, one main issue is perfomance.
But there are for sure other reasons that I ignore,
I never used .htaccess and so I can't say too much about its use
and its limitations about rewrite rules.
I think that if you can use httpd.conf,
even if you will have to reboot apache.
mod_rewrite is the name of the module.

Check this document
http://httpd.apache.org/docs/mod/mod_rewrite.html
in particular the "API Phases".

As I said, please move further questions to apache forum....

ps ( to your edited post )
do not be intimidated by "perfomance issue",
we are not talking about "minardi" and "ferrari"

Last edited by pippo : May 29th, 2002 at 04:08 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > [?] work without showing '.php' extension ?


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 attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT