![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
|
Code:
RewriteEngine On RewriteRule downloads/?dl_cat=([[:digit:]]+) /downloads/$1/ [R,L] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
►SouthOfHeaven
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
wtf
Industry Role:
Join Date: Sep 2001
Location: Bikini State, FL USA
Posts: 10,914
|
is this kindergarten?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
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/
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Apr 2004
Location: Toronto, ON
Posts: 1,706
|
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.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |