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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:56:24+00:00 2026-05-13T07:56:24+00:00

I have this apache rewrite rule: RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} mycompany.com RewriteRule

  • 0

I have this apache rewrite rule:

  RewriteEngine on
  RewriteBase /
  RewriteCond %{HTTP_HOST} mycompany.com
  RewriteRule ^$  http://mycompany.com/login   [L]
  # we check if the .html version is here (caching)
   RewriteRule ^$ index.html [QSA]
   RewriteRule ^([^.]+)$ $1.html [QSA]
   RewriteCond %{REQUEST_FILENAME} !-f

   # no, so we redirect to our front web controller
   RewriteRule ^(.*)$ index.php [QSA,L]

The only thing I can make sense of is if it’s mycompany.com, then the script will redirect to http://mycompany.com/login. If not, then …

I can’t figure out already.

Any idea what does the above script say?

  • 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-13T07:56:24+00:00Added an answer on May 13, 2026 at 7:56 am

    Something quite interesting, not easy to understand.
    A google search on the comment texts inside the code gave interesting results: http://www.google.com/search?q=%22%23+we+check+if+the+.html+version+is+here+%28caching%29%22

    Edit: if we look at the last lines and knowing that Symfony uses caching (it creates local files with .html extension in the same directories as the URL shows ’em) I can try to explain the lines here

    If the requested url is something like http://yoursite.com/blabla/ we try to open an index.html file in that directory. If the file is not there, another cycle of rewriting will happen and the last Cond will be hit (where the file does not exist)

    RewriteRule ^$ index.html [QSA]
    

    If something more is in the url, like http://yoursite.com/blabla/blblbl, try to find a file blblbl.html

    RewriteRule ^([^.]+)$ $1.html [QSA]
    

    This is the collector of all urls that did not match any of the previous rules or the cached file did not exist:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have PHP source code of http://www.sitename.com . This site is located on Windows
I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
I'm using http://github.com/lakshmivyas/hyde to generate my website, and it included .htaccess mod_rewrite rules, but
Once in a while I have to fuddle around with mod_rewrite or rather Apache's
I have a simple project in which I'm attempting to do some rewriting of
I'm setting up a site using a php bootstrap. It seems the ErrorDocument directives
I just moved my Wordpress site from using nginx to Apache2, and found that
I publish webcal URLs which allow users of my web app to subscribe to
I am caching pages in my (Rails) application based on subdomain. The pages for

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.