Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 13th, 2012, 07:23 PM
drumn4life0789 drumn4life0789 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 129 drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 1 m 20 sec
Reputation Power: 10
Mod Rewrite Frustration

I am trying to do a very simple mod rewrite and I cannot seem to figure out the correct way to do it.


I want something like this.

on this page. www.domain.com/foo

I have links that look like so

www.domain.com/foo/bar

I want those links to go to

www.domain.com/foo/baz.php?name=bar

I think the problem is occurring because these links are urlencoded meaning they have % signs and things like that

Here is what I have.

RewriteRule ^/(.+)$ club.php?name=$1 [L]

Reply With Quote
  #2  
Old August 13th, 2012, 09:33 PM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,869 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 6 h 19 m 22 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
I don't see how you turned
Quote:
I have links that look like so

www.domain.com/foo/bar

I want those links to go to

www.domain.com/foo/baz.php?name=bar

into
Code:
RewriteRule ^/(.+)$ club.php?name=$1 [L]

Where'd the subfolder go?

Quote:
Originally Posted by drumn4life0789
I think the problem

What problem would that be?

Reply With Quote
  #3  
Old August 13th, 2012, 11:20 PM
drumn4life0789 drumn4life0789 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 129 drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level)drumn4life0789 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 23 h 1 m 20 sec
Reputation Power: 10
well I have the htaccess file in the foo sub folder.

and the rewrite should say

RewriteRule ^/(.+)$ baz.php?name=$1 [L]

Im just lost. I want.

www.domain.com/foo/anythinghere

to actually go to here.

www.domain.com/foo/baz.php?name=anythinghere

Reply With Quote
  #4  
Old August 13th, 2012, 11:52 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Dec 2004
Posts: 8,057 E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)E-Oreo User rank is General 92nd Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 1 Day 5 h 51 m 35 sec
Reputation Power: 7104
If you define rewrite rules in a .htaccess file in a subdirectory you need to specify a RewriteBase directive in the .htaccess file.
__________________
PHP FAQ
How to program a basic, secure login system using PHP
Connect with me on LinkedIn


Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Mod Rewrite Frustration

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap