Reply
Offer "virtual paths" only, instead redirection?
Old 05-20-2009, 01:23 PM Offer "virtual paths" only, instead redirection?
c2k
c2k's Avatar
Skilled Talker

Posts: 69
Location: Germany
Trades: 0
Hey there,

I'm not totally sure, if I'm in the correct forum. If not, please move the post as appropriate.

Is there a way to have Apache redirect requests whatever path (e.g. domain.com/path/to/whatever) to domain.com/index.php and have the index.php scipt know the path, which has originally been accessed? I'd like to have only a single index.php, but on the other hand would like to offer stable links in the form as described above. But I actually don't want to have a file in every path lying (e.g. a PHP file doing the redirection). I'd prefer if these path's are only virtual. The index.php could read the path and look it up in a db or whatever and retrieve the input according to the path.

Example:

I don't want this:
domain.com/index.php?path=/path/to/whatever

but I do want:
domain.com/path/to/whatever
which redirects to index.php in a way to let index.php now the path from which it has been redirected, but the user shall never see this. I shall be written in the browsers bar domain.com/path/to/whatever

Dou you understand what I mean? Is this possible?

Cheers,
c2k
c2k is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 09-27-2009, 05:55 PM Re: Offer "virtual paths" only, instead redirection?
c2k
c2k's Avatar
Skilled Talker

Posts: 69
Location: Germany
Trades: 0
Nobody?
c2k is offline
Reply With Quote
View Public Profile
 
Old 09-27-2009, 11:58 PM Re: Offer "virtual paths" only, instead redirection?
cpace1983's Avatar
Average Talker

Latest Blog Post:
When Not to Outsource
Posts: 21
Name: Christopher Pace
Trades: 0
Well, I guess you could technically do it via a 404 document (have the /path/to/whatever not exist, and Apache configured to serve index.php on a 404, then pull the variable with the PHP file.

You would also have to write an exception to deal with real 404s, but it would work...
__________________
I am a Linux server consultant.
I offer flat rate Linux support, as well as hourly support.
My wife is a Billings, Montana photographer
cpace1983 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Offer "virtual paths" only, instead redirection?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB 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.14671 seconds with 13 queries