Multiple SubDirectories problem

Discuss practical ways rearrange URLs using mod_rewrite.

Multiple SubDirectories problem

Postby 2levelsabove » Fri Dec 19, 2008 3:44 pm

ok so my site has the structure of

Classifieds/Make/Model/Listings

This is the rule that I am using:

Code: Select all
RewriteRule ^Classifieds/([a-z0-9-]+)/?$                      /classifiedsbymake.php?make=$1              [NC,QSA,L]
RewriteRule ^Classifieds/([a-z0-9-]+)/([a-z0-9-]+)?$         /classifiedsbymodel.php?model=$2             [NC,QSA,L]



I cannot seem to go further than Model.

Please look at: http://alltherides.com/Classifieds/Acura/

Thanks
2levelsabove
 
Posts: 12
Joined: Sun Feb 03, 2008 11:38 pm

Postby richardk » Sat Dec 20, 2008 11:05 am

I cannot seem to go further than Model.

I don't really understand what you are trying to say. Examples of what works and what doesn't would be helpful.

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^Classifieds/([a-z0-9-]+)/?$                       /classifiedsbymake.php?make=$1   [NC,QSA,L]
RewriteRule ^Classifieds/[a-z0-9-]+/([a-z0-9-]+)/?$            /classifiedsbymodel.php?model=$1 [NC,QSA,L]
# Another rule for listings.
RewriteRule ^Classifieds/[a-z0-9-]+/[a-z0-9-]+/([a-z0-9-]+)/?$ /listings.php?listing=$1         [NC,QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 28 guests

cron