Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Permalinks?

Permalinks?
Thread Tools
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Aug 5, 2005, 03:07 PM
 
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
Reply With Quote
Aug 5, 2005, 03:22 PM
 
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
Reply With Quote
Aug 7, 2005, 05:39 PM
 
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
Reply With Quote
Aug 7, 2005, 08:10 PM
 
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
Reply With Quote
Aug 8, 2005, 06:55 AM
 
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!
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:24 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2