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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:07:29+00:00 2026-05-28T11:07:29+00:00

I have my .htaccess file setup like the following. It’s a simple concept where

  • 0

I have my .htaccess file setup like the following. It’s a simple concept where all requests get forwarded to the cgi-bin/controller.rb except for those requests for anything in /images, /css, /javascripts, or /cgi-bin

I also want the root to just be redirected to /index/show but that’s the part which is erroring. It just keeps infinitely redirecting to /index/showindex/showindex/show…

Can anyone explain why my redirectmatch doesn’t work?

RedirectMatch permanent ^/$ /index/show

ErrorDocument 404 /404

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/images/ [NC]
RewriteCond %{REQUEST_URI} !^/css/ [NC]
RewriteCond %{REQUEST_URI} !^/javascripts/ [NC]
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
RewriteRule (.*) /cgi-bin/controller.rb?%{QUERY_STRING}&page=$1 [L]
  • 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-28T11:07:30+00:00Added an answer on May 28, 2026 at 11:07 am

    Avoid using RedirectMatch and RewriteRule at the same time. Those are different modules and are applied at different times in the request-flow. You can achieve the same using only RewriteRule’s:

    RewriteEngine on
    
    RewriteCond %{REQUEST_URI} !^/index/show [NC]
    RewriteRule ^$ /index/show [L]
    
    RewriteCond %{REQUEST_URI} !^/index/show [NC]
    RewriteCond %{REQUEST_URI} !^/images/ [NC]
    RewriteCond %{REQUEST_URI} !^/css/ [NC]
    RewriteCond %{REQUEST_URI} !^/javascripts/ [NC]
    RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
    RewriteRule (.*) /cgi-bin/controller.rb?page=$1 [L,QSA]
    

    Optionally use RewriteRule ^$ /index/show [L,R=301] if you really want the redirect, instead of leaving the address bar nice and clean.

    Also remember to clear the browsers cache, as the Permanent redirect are cached very aggressively.

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

Sidebar

Related Questions

I have a very simple .htaccess file set up to redirect a 404 to
I have an .htaccess file with following content: AddHandler x-httpd-php5 .php For some reason,
In my root directory I have a htaccess file which is caching all sort
I have the following .htaccess file in a directory: RewriteEngine On RewriteCond %{HTTPS} !=on
I'd like to know why the following htaccess file produces a 500 error: <IfModule
I have an .htaccess file set up like so: RewriteEngine on RewriteRule ^home/ /member.php
I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1
I have such .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php
I have a .htaccess file in the root of a website: /var/www/mywebsite/htdocs/.htacess and I
I have this .htaccess file in WordPress. It's located at /public_html/ (web root). 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.