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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:07:27+00:00 2026-05-13T00:07:27+00:00

Here is my .htaccess file Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule subpage\?sid /index.php

  • 0

Here is my .htaccess file

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteRule subpage\?sid /index.php [R=301,L,NC]

My request is http://example.com/subpage?sid

It keeps returning 404 Not Found, rather than redirecting to index.php

I have tried not escaping the ? and changing the request to http://example.com/subpage\?sid

I have tried loads of things to try get this working but am now stumped.

  • 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-13T00:07:27+00:00Added an answer on May 13, 2026 at 12:07 am

    The QUERY_STRING is not part of the URI. From the documentation for RewriteRule:

    Note: Query String

    The Pattern will not be matched against the query string. Instead, you must use a RewriteCond with the %{QUERY_STRING} variable.

    As the doc says, you’ll need to use a RewriteCond, something like:

    RewriteCond %{QUERY_STRING} (^|&)sid([&=]|$) [NC]
    RewriteRule ^/?subpage /index.php [R=301,L,NC]
    

    If %{QUERY_STRING} truly isn’t an option, try:

    # Apache is supposed to use PCRE, but doesn't seem to like "\\s"
    RewriteCond %{THE_REQUEST} subpage?sid[^!-~] [NC]
    RewriteRule ^/?subpage /index.php [R=301,L,NC]
    

    Also, you almost never need RewriteBase as you’re using it (“RewriteBase /”). Comment the line and test it to be sure, but you’ll probably find you can delete it with no ill affect.

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

Sidebar

Related Questions

Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule
Here is my htaccess file Options +FollowSymLinks RewriteEngine on # For Accessing Page http://www.domain.com/news/news-details.php
Here is the code I have currently in my .htaccess file: Options +FollowSymLinks RewriteEngine
in my .htaccess file i do have these lines: Options +FollowSymLinks RewriteEngine on RewriteCond
Here's what my htaccess looks like: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.site.com$ [NC]
Trying to set 301 redirect in .htaccess file and here is what i am
here is my .htaccess file, it works because the first rewriterule correctly redirects .html
Here's the mod_rewrite portion of my .htaccess Options +FollowSymlinks Options -Indexes # Prevent Direct
I have some problem with my .htaccess file. Here I am adding my problem.
im facing a problem regarding my .htaccess file here is the code within the

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.