Reply
Is mod_rewrite Serverside or does it simply redirect?
Old 10-05-2007, 02:20 AM Post Is mod_rewrite Serverside or does it simply redirect?
mwsource's Avatar
Skilled Talker

Latest Blog Post:
No Away Message Required.
Posts: 57
Name: Reid
Location: Georgia, USA
Hey guys,

Was wondering this:
If I wanted to use mod_rewrite (in .htaccess) to redirect a page to another page (or file), does:
  • Apache tell the browser to go to that new location? - OR -
  • Apache serve the page as scripted in .htaccess?

Ok, that's a little tricky. Real world example:
A webmaster of a file hosting site wants to generate a key for each individual download. So he temporarily creates a 'key' that expires after so much time (This is handled by PHP) that looks like this and is visible to the visitor:
Quote:
somedomain.com/downloadfile/[xxkeyxx]/
However the file to be downloaded is located here:
Quote:
somedomain.com/files/somedoc.pdf
If I were to tell .htaccess if the first url is to be 'rewritten' to the second url, does that mean that the second url is sent to the visitor's browser or does it not?

Thanks guys-
__________________
Reid Workman - My Blog - Free Media Community - Try Freelancing for a living
mwsource is offline
Reply With Quote
View Public Profile Visit mwsource's homepage!
 
When You Register, These Ads Go Away!
Old 10-05-2007, 02:38 AM Re: Is mod_rewrite Serverside or does it simply redirect?
tripy's Avatar
Fetchez la vache!

Posts: 2,054
Name: Thierry
Location: In the void
Answer's 2: Apache interprets the path, and serve content upon the translated path.
The browser is not redirected.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Is mod_rewrite Serverside or does it simply redirect?
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11218 seconds with 12 queries