Viewing 3 replies - 1 through 3 (of 3 total)
  • This is not a WordPress question.
    Regular expressions have slightly different syntax depending on whether they are in PHP or JS or in .htaccess, so I suggest you look for a reference page on the context you need the expression in, to find the correct answer.

    Maybe you should look at creating categories or custom post types. I’m not sure what you are trying to accomplish. It might be more of a taxonomy problem than URL. If you create a custom taxonomy you can create categories for that taxonomy. Here an example, if I wanted to create a theme for a restaurant I might start by creating a custom post type of menu. Once I have the menu post type I would use taxonomy to break it down into Deserts, Entrees, Drinks, .. and so on. You could then set up custom queries for the different types of taxonomies to separate them. If you base things on the URL, what happens if you need to change the permalink structure of your site.

    • This reply was modified 4 years, 2 months ago by mrtom414.
    • This reply was modified 4 years, 2 months ago by mrtom414.

    I don’t what you’re trying to do really, but this isn’t a WP question.

    Nevertheless, this will work :
    ^http:\/\/www.mysite\.com\/product($|\/.*)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘regex’ is closed to new replies.