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 March 8th, 2013, 12:56 PM
HDFilmMaker2112 HDFilmMaker2112 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 181 HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 11 h 9 m 44 sec
Reputation Power: 27
Multi-Level clean url + php query string

EDIT: The PHP half of this is solved. I need some help with the Mod_Rewrite portion. If a Mod feels this should be moved, please do so.


I'm trying to use a multi-level query string based in a clean url.

So say I have:

www.domain.com/contact

I want a second page under the contact page, such as:

www.domain.com/contact/feedback

I think I may have an issue with my mod_rewrite rule.

Here's my mod_rewrite rule:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([^/]+)/?([^/]+)/?([^/]+)/? /index.php?p=$1&s=$2&t=$3 [L,QSA]

Last edited by HDFilmMaker2112 : March 8th, 2013 at 01:09 PM.

Reply With Quote
  #2  
Old March 8th, 2013, 01:34 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,710 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 4 Days 6 h 44 m 28 sec
Reputation Power: 8969
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
So /contact/feedback goes to
Code:
index.php?p=contact&s=feedback&t=

Your Rule requires something in each of the three "directories". Try changing the second and third to use a * instead.

Reply With Quote
  #3  
Old March 8th, 2013, 01:59 PM
HDFilmMaker2112 HDFilmMaker2112 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 181 HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level)HDFilmMaker2112 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 11 h 9 m 44 sec
Reputation Power: 27
Solved. Just dealt with the problem via PHP, by using
if($_GET['s']!='') and if($_GET['t']!='')

PHP Code:
if(isset($_GET['p'])){
    
$URL=$_GET['p'];
        
//if /home is in URL redirect back to base domain name
        
if($URL=="home"){
        
header("Location: /");
        }else{}
        
//if 's' is set in the URL overwrite $URL with sub-page name
        
if(isset($_GET['s']) && $_GET['s']!=''){
        
$URL=$_GET['s'];
            
//if 't' is set in the URL overwrite $URL with sub-sub-page name
            
if(isset($_GET['t']) && $_GET['t']!=''){
            
$URL=$_GET['t'];
            }else{}
        }else{}
    }
    else{
    
$URL="home";
    } 

Last edited by HDFilmMaker2112 : March 8th, 2013 at 02:01 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Multi-Level clean url + php query string

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