Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-17-2008, 11:09 PM   #1
xanx
Confirmed User
 
Join Date: Apr 2002
Location: Orlando, FL
Posts: 3,711
anyone know how to do a simple url rewrite?

All I want to do is change a URL that looks like this

/downloads/?dl_cat=3

to something like

/downloads/name-of-download/

I can't seem to get it to work
xanx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-17-2008, 11:51 PM   #2
vending_machine
Confirmed User
 
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
Code:
RewriteEngine On
RewriteRule downloads/?dl_cat=([[:digit:]]+) /downloads/$1/ [R,L]
Assuming "name of download" in that example is 3? I think that ought to do it..
__________________
vending_machine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-18-2008, 12:31 AM   #3
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
heh i think he wants the opposite of that ( se friendly urls )
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-18-2008, 12:32 AM   #4
BV
wtf
 
BV's Avatar
 
Industry Role:
Join Date: Sep 2001
Location: Bikini State, FL USA
Posts: 10,914
is this kindergarten?
BV is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-18-2008, 02:00 AM   #5
cezam
Confirmed User
 
Join Date: Jun 2003
Location: CZ, EU
Posts: 1,363
Ok you need to do this:

Modify your script so that it takes name of the download as a parameter, eg:

/downloads/?dl_name=name_of_download

then, edit your .htaccess file:

Code:
RewriteEngine On
RewriteRule downloads/?dl_name=([A-Za-z0-9_-]+)$ /downloads/$1/
This should work.
__________________
cezam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-18-2008, 02:05 AM   #6
cezam
Confirmed User
 
Join Date: Jun 2003
Location: CZ, EU
Posts: 1,363
sorry i screwed up, the htacces should be:

Code:
RewriteEngine On
RewriteRule  /downloads/([A-Za-z0-9_-]+)/$ downloads/?dl_name=$1
__________________
cezam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-18-2008, 02:06 AM   #7
Linguist
Confirmed User
 
Join Date: Apr 2004
Location: Toronto, ON
Posts: 1,706
Quote:
Originally Posted by xanx View Post
All I want to do is change a URL that looks like this

/downloads/?dl_cat=3

to something like

/downloads/name-of-download/

I can't seem to get it to work
Use what everyone else said & dynamically add "name-of-download" as a part of url, so you'd have something like /downloads/3-name-of-download/. Take first # and forward that to /?dl_cat=3. If you're hell bent on that just having /name-of-download then you can do it in mysql and you'd have /?dl_cat=name-of-download and then you'd get id from the database. The first way is easier.
__________________
315-310
Linguist is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.