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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:53+00:00 2026-06-05T12:09:53+00:00

I have some rewrite rules in an htaccess file. I’m still getting into it

  • 0

I have some rewrite rules in an htaccess file. I’m still getting into it so theres a few things I’m unsure of.
Basically I want all pages (except the /register page) to be rewritten like this: http://www.example.com/about -> http://www.example.com?page=about

To get that right I wrote this rule:

RewriteRule ^([a-z-_1-9]+)+/?$ ./?page=$1&%{QUERY_STRING} [L]

I then wrote this rule below the one above thinking it would override it, but it doesnt…

RewriteRule ^register/?$ ./?page=login&option=register

So going to /register gives me a 404. However if I comment out the first rule then the register page works.
I was thinking it would work like CSS where writing a new rule below would take precedence.
How would I get this right and how do you override previously written rewrite rules?

Thanks!

  • 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-05T12:09:54+00:00Added an answer on June 5, 2026 at 12:09 pm

    .htaccess is not CSS — especially when it comes to mod_rewrite instructions/rules.

    The rules are executed from top to bottom. Therefore — put more specific rules at top and then more generic at bottom.

    In your case:

    RewriteRule ^register/?$ ./?page=login&option=register [L]
    RewriteRule ^([a-z-_1-9]+)+/?$ ./?page=$1&%{QUERY_STRING} [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make some url rewrite rules on my .htaccess file so that
I am new to url-rewriting. I have written few rewrite rules in the .htaccess
I have the following rewrite rules in my .htaccess file: RewriteEngine on RewriteRule ^news/([0-9]+)/?$
I have a small htaccess file, which contains some simple rules. First I want
I'm trying to rewrite some old SQL into LINQ to SQL. I have a
I would like to create rewrite rules in my .htaccess file to do the
I have the following .htaccess to rewrite my domain.com/ to domain.com/public/ # Rewrite rules
i need some help regarding rewrite rules of .htaccess, and some of the regular
I have a small issue with some .htaccess rules on our website - http://www.presencemultimedia.co.uk
I have the following rewrite rule in my .htaccess file: RewriteRule ^([^/]+)/([^/]+)/(tab:([^/]+)/?)?(scope:([^/]+)/?)?(sort:([^/]+)/?)?(p:\d+)/?)?$ web/results.php?view=$1&q=$2&tab=$4&searchscope=$6&sortBy=$8&page=$10 [NC,QSA,L]

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.