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 823637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:58:44+00:00 2026-05-15T02:58:44+00:00

building a site which has content for each section. urls range from; /work/ /work/print/

  • 0

building a site which has content for each section.

urls range from;
/work/
/work/print/
/work/print/folders etc.

however, at any point a user can click on an article so;
/work/article/1066
/work/print/article/1066
/work/print/folders/article/1066

using .htaccess i need to detect when there is ‘article’ in the url and set some different variables.

RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/$ 
sets  index.php?level1=$1&level2=$2&level3=$3&level4=$4

but if ‘article/([0-9-]+)’ is in the url, say /work/print/article/1066 return
index.php?level1=$1&level2=$2&articleID=1066

basically the amount of levels will always be different but i’d like to return those as needed.
another example would /work/print/folder/archive/article/1066 return

index.php?level1=$1&level2=$2&level3=$3&level4=$4&articleID=1066

any help appreciated! Dan

  • 1 1 Answer
  • 1 View
  • 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-15T02:58:45+00:00Added an answer on May 15, 2026 at 2:58 am

    in the end i just did it manually! (though would prefer a more expansive solutions)

    # MENU ###
    
    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/$  index.php?level1=$1&level2=$2&level3=$3 [L]
    
    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/$  index.php?level1=$1&level2=$2 [L]
    
    RewriteRule ^([a-zA-Z0-9\-]+)/$  index.php?level1=$1 [L]
    
    
    ###  WITH ARTICLE  ###
    
    
    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/article/([0-9\-]+)/([a-zA-Z0-9\-]+)$$  index.php?level1=$1&level2=$2&level3=$3&articleID=$4 [L]
    
    RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/article/([0-9\-]+)/([a-zA-Z0-9\-]+)$$  index.php?level1=$1&level2=$2&articleID=$3 [L]
    
    RewriteRule ^([a-zA-Z0-9\-]+)/article/([0-9\-]+)/([a-zA-Z0-9\-]+)$  index.php?level1=$1&articleID=$2 [L]
    
    
    RewriteRule ^$  index.php?level1=home [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a site that has products, each of which belongs to one or
I'm building a freelancing site (think scriptlance) which has listings of projects both on
I'm building a Drupal site, which has 4 different themes with different theme templates.
I'm currently building a site which has a bunch of main categories and in
I'm building a ASP.Net MVC site, which has some small islands of non MVC
I am currently building a tool which creates SharePoint sites automatically. Each site must
I'm building a WSS site which has to show SVG files stored on WSS.
I'm building a site (with jQuery 1.4) which has a floating (fixed position) basket.
I'm building a site that has items, with each item having a page, for
I am building a subscription based web site, which currently has three subscription levels,

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.