Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Help with ReWrite rules
Old 05-15-2009, 04:09 AM Help with ReWrite rules
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
Hello,

Im having some issues with rewrite rules, possibly someone has some suggestions:

RewriteRule ^gps/(.*)/$ gps/index.php?category=$1

that is my rewrite rule, and it works great if I do:

http://www.transeca.com/gps/category/

but I want to go one level deeper:

http://www.transeca.com/gps/category/product/

so I change the rewrite rule to:

RewriteRule ^gps/(.*)/(.*)/$ gps/index.php?category=$1&product=$2

now I can goto:

http://www.transeca.com/gps/category/product/

but I can no longer goto just:

http://www.transeca.com/gps/category/

I get:
Not Found

The requested URL /gps/category/ was not found on this server.


Anyone know how to over come this hurdle? Do I need to use some kind of conditional statement, or 2 separate rules?
bmp99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-15-2009, 06:55 AM Re: Help with ReWrite rules
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
this was solved by adding an additional rule:

RewriteRule ^gps/(.*)/$ gps/index.php?category=$1
RewriteRule ^gps/(.*)/(.*)/$ gps/index.php?category=$1&product=$2

However, now when I goto:

http://www.transeca.com/gps/category/product/

category ($1) is showing as index.php
product ($2) shows correctly as product (or whatever was n the URL)

any ideas?
bmp99 is offline
Reply With Quote
View Public Profile
 
Old 05-15-2009, 07:16 AM Re: Help with ReWrite rules
Skilled Talker

Posts: 55
Name: Brian
Trades: 0
ahh-

that was fixed by changing the rule to:

RewriteRule ^gps/(.*)/$(.*)/$ gps/index.php?category=$1&product=$2

i guess im finished ranting now
bmp99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with ReWrite rules
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18304 seconds with 12 queries