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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:14:55+00:00 2026-05-31T08:14:55+00:00

I have the following rule which redirects the page example2.test.com to www.example2.test.com/index.shtml — i.e.

  • 0

I have the following rule which redirects the page “example2.test.com” to “www.example2.test.com/index.shtml” — i.e. it appends index.shtml to it

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example2.test.com$
RewriteRule (.*) http://www.example2.test.com/index.shtml [R,L]

If I change the rule to try and catch if a user enters in www.example2.test.com as per below I get an error telling me there are too many redirects

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example2.test.com$
RewriteRule (.*) http://www.example2.test.com/index.shtml [R,L]

Is there something I am mising here ?? – im a bit new to this ..

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-05-31T08:14:56+00:00Added an answer on May 31, 2026 at 8:14 am

    RewriteCond is basically an if statement, and by default the server will try to access the index page, so what your second example says is

    if uri is   www.example2.test.com
    redirect to www.example2.test.com
    

    You’re creating an infinite loop, because once it gets redirected it gets reevaluated, which redirects it.

    If you’re not getting that index.shtml page when you visit that url you might need to add index.shtml to your apache directory index. so open your httpd.conf and find where it says something like

    DirectoryIndex index.html
    

    and add index.shtml to it if it isn’t already there so you end up with

    DirectoryIndex index.html index.shtml
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following .htaccess rule: RewriteEngine on RewriteRule ^(.*) http://www.server2.com/index.php?action=$1 I need to
I have been following http://learn.iis.net/page.aspx/806/seo-rule-templates/ , which is a nearly perfect guide to creating
I have the following rule which redirects all pages - except php and php3
I have the following rewrite rule: <rewrite url=^/Membership/(.+)/(.+)/(.+)/(.+) to=/Membership/Index.aspx?parentf=$3&amp;f=$4/> which I am expecting should
I have the following dynamic URL: http://www.lakaweb.com/dev/cserv/index.php?a=list&car=C5&year=2012&engine=1.8-HDi in which I rewrite to http://www.lakaweb.com/dev/cserv/list/C5/2012/1.8-HDi with:
Suppose I have the following CSS rule in my page: body { font-family: Calibri,
I have website which works fine and have following in the htaccess file RewriteEngine
I have following Drools rule to which I send map filled with element ,
I have the following url which i want to write a helicon RewriteRule rule
I have the following rewrite rule in my web.config which is working fine <rule

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.