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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:30:54+00:00 2026-06-07T09:30:54+00:00

I already created a rule that allows users to pass a variable like this:

  • 0

I already created a rule that allows users to pass a variable like this: somepage.com/database/12345 which internally changes it to somepage.com/database/?db_index=12345 and it works fine. The code looks like this:

RewriteBase /
RewriteRule ^database/([0-9]+)/?$ /database/?db_index=$1

Now I need to do exactly the same but without the need to pass “database/” before the variable. So the users can pass the variable like this: somepage.com/12345. It has to be an additional option, not a replacement for the previous one. I tried to do this like that:

RewriteRule ^([0-9]+)/?$ /database/?db_index=$1 [L]

but I just can’t get this to work and I have no idea why. The additional code above is inserted directly before the previous working rule.

I’ll be really happy for any help and explanation why my method doesn’t work.

UPDATE: the whole .htaccess file looks like this:

# Block the include-only files.
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]

# direct url rewrite
RewriteEngine On
RewriteBase /
RewriteRule ^([0-9]+)/?$ /database/?db_index=$1 [L]
RewriteRule ^database/([0-9]+)/?$ /database/?db_index=$1

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
  • 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-07T09:30:55+00:00Added an answer on June 7, 2026 at 9:30 am

    Yours looks fine to me, but try: RewriteRule ^/?([0-9]+)/?$ /database/?db_index=$1 [R=301]

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

Sidebar

Related Questions

is there any custom asp.net membership providers that someone has already created online. I
I'd like to know if there is a simple (or already created) way of
I want to update a Post and change relationships with Categories that already created
We have already created the database framework, with all the relations and dependencies. But
I have already created a report using list of data from my database. i
I have an already created DataTable object which i am using for my girdview
I already created my xcdatamodel file. Then I follow instruction in http://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/XcodeCoreDataTools/Articles/xcdCreatingUserInterface.html#//apple_ref/doc/uid/TP40006854-SW1 So I
i already created a table for comments but i want to add the feature
I already created a top level Web Application and site collection. The powershell input
I have already created a webpart to show the data from list, but 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.