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

  • SEARCH
  • Home
  • 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 9068209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:08:15+00:00 2026-06-16T17:08:15+00:00

For example, I can write the following .htaccess rule at the base directory of

  • 0

For example, I can write the following .htaccess rule at the base directory of my domain (/):

RewriteRule ^something/[bd]on$ foo.php [L]

Which would match the following URLs, providing my domain is www.example.com:

http://www.example.com/something/bon
http://www.example.com/something/don

right? But how would I put words in there to match? For example, apple and cheese, so that it only matches:

http://www.example.com/something/apple
http://www.example.com/something/cheese

Note that I have around 40 different possibilities after something/, so please provide me with an .htaccess rule which can accommodate that.

  • 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-06-16T17:08:17+00:00Added an answer on June 16, 2026 at 5:08 pm

    40 words sounds long but AFAIK, the only way to make a Regex pattern match a set of options is to explicitly write them in parantheses, separated by the pipe | character.

    So I think RewriteRule ^something/(word1|word2|word3)$ foo.php [L] should work for you.

    EDIT:

    I forgot to mention. To shorten the list you can use character groups/ranges and conditions for the words (such as colou?r or gr[ae]y) but that will make it look confusing later when you need to edit it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, how can I write an expression where the following is implicitly applied:
How can i write a javascript alert inside php ? For example if i
How to write byte by byte to socket in PHP? For example how can
How can I better write the following class? For example is there a nice
In MATLAB, we can write to the editor the following %% -- a example
how can i write dynamic javascript any simple example or any references. thanking you
Can you write preprocessor directives to return you a std::string or char*? For example:
Can anybody give any working example of how to read/write Unicode text files using
For example can i have something like this: public static void SAMENAME (sameparameter n)
I have a project that lives at the following domain: http://www.example.com/PROJECT/ within project, there

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.