Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3355230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:22:10+00:00 2026-05-18T02:22:10+00:00

I want to use static URLs on my site, so when a user goes

  • 0

I want to use static URLs on my site, so when a user goes to

http://www.domain.com/toys/ – he will see the toys category page

and when he goes to

http://www.domain.com/toys/playing-cards – he will see the product page

I am having some trouble with the following rewrite rule:

RewriteRule ^item/(toys|clothes)/(.*)/?$ showPRODUCT.php?id=$2 [NC,L]
RewriteRule ^item/(toys|clothes)/?$ showCATEGORY.php?product=$1 [NC,L]

because the first rule “catches” the category URL (http://www.domain.com/toys/) in addition to the product (and vice versa if I switch the order).

Any ideas?

Thanks!!

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:22:11+00:00Added an answer on May 18, 2026 at 2:22 am
    RewriteRule ^item/(toys|clothes)/(.*)/?$ showPRODUCT.php?id=$2 [NC,L]
    RewriteRule ^item/(toys|clothes)/?$ showCATEGORY.php?product=$1 [NC,L]
    

    Assuming the “^item” at the beginning is supposed to be there…

    What you need is to change the * repeater to a + repeater, that way it won’t match the category. Likewise, the L flag should stop it from continuing with the other rewriterule if it finds the first one:

    RewriteRule ^item/(toys|clothes)/(.+)/?$ showPRODUCT.php?id=$2 [NC,L]
    RewriteRule ^item/(toys|clothes)/?$ showCATEGORY.php?product=$1 [NC,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my site to use URLs like http://192.0.2.2/... and https://192.0.2.2/... for static content
I want to use oscpack ( http://code.google.com/p/oscpack/ ) as a static library for my
Example url: http://p.static.com/i/logo.jpg I want to be able to extract the urls from my
Currently, I have URLs that look like this: http://www.example.com/user/create http://www.example.com/user/edit/1 But now, I have
I Want to know which one is preferred while coding to use Static Methods
For testing purposes I want to use Jetty 8 to serve only static content.
I have a static front page in Wordpress and I want to use a
I have created a public static class utils.cs I want to use it in
I have a standard node.js static file server that I want to use to
I'm trying to make the URLs of my site SEO and user friendly. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.