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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:29:11+00:00 2026-06-16T17:29:11+00:00

I have a domain like example.test.com . The website consists of three different html

  • 0

I have a domain like example.test.com. The website consists of three different html files:

  • index.html
  • products.html
  • contact.html

So if a user types in example.test.com/index.html the url should be redirected to example.test.com.

Also example.test.com/index should become example.test.com

example.test.com/contact.html should be example.test.com/contact and so on.

Their should be no www before the url.

I came up with the following rules:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^example.test.com$ [NC]
RewriteRule ^(.*)$ http://example.test.com/$1 [L,R=301]

RewriteCond %{SCRIPT_FILENAME}/ -d
RewriteCond %{SCRIPT_FILENAME}.html !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.+)\.html$ /$1 [R=301,L]

RewriteCond %{SCRIPT_FILENAME}.html -f
RewriteRule [^/]$ %{REQUEST_URI}.html [QSA,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(html?|php)\ HTTP/
RewriteRule ^index\.(html?|php)$ http://example.test.com/ [R=301,L]

In Firefox everything works as expected, but in Chrome and Internet Explorer example.test.com/index.html is only redirected to example.test.com/index and I don’t know why.

  • 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-16T17:29:12+00:00Added an answer on June 16, 2026 at 5:29 pm

    I’m not really sure what you are trying to achieve with the ^[A-Z]{3,9}\ part but the culprit here is the dot at the end of index in your last condition. Change it to :

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index(|\.html|\.php)\ HTTP/
    RewriteRule ^index\.(html?|php)$ http://example.test.com/ [R=301,L]
    

    and this should work fine.

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

Sidebar

Related Questions

I have a domain which shows like so www.example.co.uk/index.php Different sections of the site
I would like to have a url that is domain.com/Test/index route to the same
I have an application with URLs such as these: https://www.domain.com/example/public/subscription https://www.domain.com/example/public/subscription/source https://www.domain.com/example/public/test/subscription I'd like
I have a page, URI looks like this: http://domain.example.com/Profiles/Profile.aspx?username=blah#blahtab When that fragment (#blahtab) is
I have some pdf files located on a http server: Like: http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf
so we had a development site up for example: test.domain.com/dev/filename.html and its been indexed
I have an app in a domain like this http://www.example.com/ , but I need
It's easier to be told by example. I have URLs like http://domain/product/view/id/ . How
I have a url which has some get variables in it like: domain.com/recover?email=my@email.com&token=abc123 inside
Hi i have 3 Yii based systems, something like: sys1.domain.com sys2.domain.com sys3.domain.com now, this

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.