 |
 |
Permalinks?
|
 |
|
 |
|
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status:
Offline
|
|
Can anyone tell me how permalinks work?
I'm working on a site with a database behind it, and I want to set it up such that if someone goes to www.domain.com/foo it will display the appropriate entries for 'foo' and if they go to www.domain.com/bar it it will do the same for 'bar'. Obviously I could use GET info and so something like www.domain.com/?string=foo, but that's not nearly as clean looking and it's obviously possible to do what I want since it's used by blogs and news sites all over the place.
Can anyone give me some pointers on this? Google is pretty much useless as almost every blog out there contains the word 'permalink' on it somewhere.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I think what you're wanting is mod_rewrite.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
mod_rewrite is the most common way to deal with permalinks. You take "clean" URLs, scrape information out of them, and then pass them on to your script in the "dirty" format.
You can also write your scripts to actually parse out the URL passed into them. No matter what a URL may be, Apache will go to the first file it finds in the URL, so http://foo.com/index.html and http://foo.com/index.html/one/two/three/four/five actually retreive the first index.html if it exists. However, this is generally considered to be more work than it's worth unless you need to be server-agnostic. Many Apache users prefer to use mod_rewrite instead.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
If your host is Godaddy, give up now. They "don't support" mod_rewrite if the target is a PHP file. I still don't know what the rationale is for that.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
mod_rewrite can cause security issues if you're not very as to how you configure it. That's probably why Godaddy bans it.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |