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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:34:57+00:00 2026-05-29T06:34:57+00:00

For a main menu I’ve got about 3 header catagoty’s I like to static

  • 0

For a main menu I’ve got about 3 header catagoty’s
I like to static rewrite them.

This is the code i’m using now:

RewriteCond %{QUERY_STRING} !dep= [NC]    
RewriteRule ^([0-9a-zA-Z-]+)/?$ index.php?dep=$1 [NC,L,QSA]   

http://www.hello.com/car/ will give the //$_GET var //?dep=car

simple how would I let: http://www.hello.com/car/ford/
let ‘return’ ?dep=car&id=ford

Now let say I know the 3 ‘?dep’ paramters I’m using. How could you write:

If www.hello.com/? == car || boat || train  /  
rewrite to ?dep=  
else
rewrite to ?id= 

/*
In this example giving www.hello.com/ford/  
would return id=ford     
but, www.hello.com/boat/  
would return dep=boat 
*/
  • 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-29T06:34:58+00:00Added an answer on May 29, 2026 at 6:34 am

    simple how would I let: http://www.hello.com/car/ford/ let ‘return’ ?dep=car&id=ford

    Add this rule after your rules:

    RewriteRule ^([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/?$ index.php?dep=$1&id=$2 [NC,L,QSA]   
    

    Now let say I know the 3 ‘?dep’ paramters I’m using. How could you write:

    You’ll need to change your conditions for this because you need to check for “id”. Then the rule would match “car”, “boat”, or “train” specifically:

    RewriteCond %{QUERY_STRING} !(id|dep)= [NC]    
    RewriteRule ^(car|boat|train)/?$ index.php?dep=$1 [NC,L,QSA]
    

    And add a second rule for the rest:

    RewriteCond %{QUERY_STRING} !(id|dep)= [NC]    
    RewriteRule ^([0-9a-zA-Z-]+)/?$ index.php?id=$1 [NC,L,QSA]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a hierarchical main menu with drupal 7, looks like this: http://dl.dropbox.com/u/16019885/Unbenannt.PNG Now,
The main structure of the page is like this: <html> <body> <div id=Menu> <h1>Menu</h1>
I'd like the main menu from this page http://www2.gardencomedyclub.co.uk to use the entire width
I use the bellow code to load the main menu elements from some CMS,
i have this html menu: <ul id='main'> <li class='active current' id='lighty'> <a href='/'>Lighty</a> <ul>
I have designed a main menu in android, but now I have no idea
My app has a main menu, and I am using a ListView to represent
I have a main menu bar at the top of my page. Now my
i have menu structure like below <ul class=menu_bg id=menu-main-menu> <li class=menu-item menu-item-type-post_type menu-item-object-page menu-item-653
I added a new page in the main menu, e.g. Products . Now I

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.