hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : mod_rewrite help
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

mod_rewrite help

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-03-2007, 07:34 PM
JRSEOMarketing JRSEOMarketing is offline
Video Creation Experts
 
Join Date: Feb 2004
Location: San Diego, CA
Posts: 2,576

mod_rewrite help


I need a little help on setting this up. Currently my URLs are:

relo.php?state=STATE
relo.php?state=STATE&region=COUNTY
relo.php?state=STATE&region=COUNTY&zone=CITY

I want to change it to /state/county/city

I need the rewrite condition and the rewrite rule. mod_rewrite is turned on as vbseo is working good on my forum.

Any help?

__________________
www.JRSEOVideoPro.com - Video Creation & Marketing Experts
█ "Building traffic one Video at a time"
█ Call us at (800) 959-0182 ext. 105 for an exclusive quote
Direct Email: sales@JRSEOMarketing.com

Reply With Quote


Sponsored Links
  #2  
Old 05-04-2007, 02:40 AM
Jatinder Jatinder is offline
Web Hosting Master
 
Join Date: Sep 2005
Location: India
Posts: 735
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^relo/([a-zA-Z-_]+)/([a-zA-Z-_]+)/([a-zA-Z-_]+)/?$ relo.php?state=$1&region=$2&zone=$3 [L]
RewriteRule ^relo/([a-zA-Z-_]+)/([a-zA-Z-_]+)/?$ relo.php?state=$1&region=$2 [L]
RewriteRule ^relo/([a-zA-Z-_]+)/?$ relo.php?state=$1 [L]
/relo/state/county/city will be rewritten to relo.php?state=STATE&region=COUNTY&zone=CITY

/relo/state/county will be rewritten to relo.php?state=STATE&region=COUNTY

/relo/state will be rewritten to relo.php?state=STATE

__________________
Darsh Web Solutions : Web Design, PHP Development, E-Commerce Solutions

PHP Tutorials : Tutorials and scripts for beginners

Reply With Quote
  #3  
Old 05-04-2007, 01:00 PM
JRSEOMarketing JRSEOMarketing is offline
Video Creation Experts
 
Join Date: Feb 2004
Location: San Diego, CA
Posts: 2,576
Jatinder thank you for replying, but I might of said it backwards. I want the long syntax to be made into /relo/state/county etc..

-Josh

__________________
www.JRSEOVideoPro.com - Video Creation & Marketing Experts
█ "Building traffic one Video at a time"
█ Call us at (800) 959-0182 ext. 105 for an exclusive quote
Direct Email: sales@JRSEOMarketing.com

Reply With Quote
Sponsored Links
  #4  
Old 05-05-2007, 09:57 PM
SweetAs SweetAs is offline
Junior Guru Wannabe
 
Join Date: Feb 2005
Location: Auckland, New Zealand
Posts: 97
Just suggesting a wizard tool for mod_rewrite I've always used http://www.mod-rewrite-wizard.com/

Reply With Quote
  #5  
Old 05-06-2007, 08:48 AM
Jatinder Jatinder is offline
Web Hosting Master
 
Join Date: Sep 2005
Location: India
Posts: 735
Quote:
Jatinder thank you for replying, but I might of said it backwards. I want the long syntax to be made into /relo/state/county etc..
I think I understood you correctly. If you have call a URL like /relo/state/county/city, it will call relo.php?state=STATE&region=COUNTY&zone=CITY

mod_rewrite won't write your URLs for you. You will have to code the URLs yourself.

__________________
Darsh Web Solutions : Web Design, PHP Development, E-Commerce Solutions

PHP Tutorials : Tutorials and scripts for beginners

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Open Source Hosting - Challenges and Opportunities for Service Providers Web Hosting News 2012-12-10 10:33:18
ProfitBricks Says its New “Next Generation Cloud” Outperforms Amazon, Rackspace Web Hosting News 2012-09-10 16:35:00
Web Host WebHostForASP.net Launches VPS Hosting Service Web Hosting News 2012-06-29 14:52:22
Q&A: Toby Owen on Rackspace's Updated Hybrid Cloud Solution Web Hosting News 2011-11-08 21:31:27


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting 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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?