htaccess to point to index.html

Discussion in 'Web Hosting' started by Turtleman, Jan 11, 2017.

  1. Turtleman

    Turtleman New Member

    Joined:
    Jan 7, 2017
    Messages:
    2
    Likes Received:
    0
    Maybe a Apache wizard can help me out a little bit here. I have two php databases,, one in a sub DIR and the other in my root DIR.. issue is they've never had a static page or landing page.. so I built a bootstrap page to use as the new "Main" page. The pages load as index.php and I want visitors to land on index.html. I did the basic edit in my htaccess but all my browsers still land on the index.php page.
    Any direction?

    heres the htaccess file

    DirectoryIndex index.html
    <IfModule mod_headers.c>
    Header unset ETag
    FileETag None
    <FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
    Header unset Last-Modified
    Header set Expires "Fri, 21 Dec 2020 00:00:00 GMT"
    Header set Cache-Control "public, no-transform"
    </FilesMatch>
    </IfModule>

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^((.)?)$ index.php?p=home [L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^(.*)$ $1 [QSA,L]

    RewriteCond $1 !^(\#(.)*|\?(.)*|\.htaccess(.)*|\.htaccess\.back(.)*|.idea\/(.)*|.svn\/(.)*|admin\.php(.)*|content\/(.)*|download\.php(.)*|ecc\/(.)*|images\/(.)*|index\.php(.)*|install\/(.)*|login\.php(.)*|readme\.txt(.)*|robots\.txt(.)*)
    RewriteRule ^(.+)$ index.php?url=$1&%{QUERY_STRING} [L]
    </IfModule>

    <IfModule mod_deflate.c>
    <FilesMatch "\.(js|css|ico|flv|jpg|jpeg|png|gif)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
     
  2. mau

    mau Staff
    Staff Member

    Joined:
    Feb 27, 2013
    Messages:
    183
    Likes Received:
    16
    Have you tried using only:

    DirectoryIndex index.html index.php

    Try that first and remove all other rules, if that works then start adding them to see which one is causing the problem. As I am assuming you are hosted with us you might need to disable temporary varnish to avoid any caching problems. If you need further assistance please send us a support ticket.
     
  3. Turtleman

    Turtleman New Member

    Joined:
    Jan 7, 2017
    Messages:
    2
    Likes Received:
    0
    Quite a bit of file edits but browser did have a small amount of caching but I also turned off cloudflare cache also.. yes I have a hosting account with you to.. LOL
    Heres the edited htaccess file

    RewriteOptions inherit

    RewriteEngine on
    DirectoryIndex index.html
    <IfModule mod_headers.c>
    Header unset ETag
    FileETag None
    <FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$">
    Header unset Last-Modified
    Header set Expires "Fri, 21 Dec 2020 00:00:00 GMT"
    Header set Cache-Control "public, no-transform"
    </FilesMatch>
    </IfModule>

    <IfModule mod_rewrite.c>


    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ $1 [QSA,L]

    RewriteCond $1 !^(\#(.)*|\?(.)*|\.htaccess(.)*|\.htaccess\.back(.)*|.idea\/(.)*|.svn\/(.)*|admin\.php(.)*|content\/(.)*|download\.php(.)*|ecc\/(.)*|images\/(.)*|index\.php(.)*|install\/(.)*|login\.php(.)*|readme\.txt(.)*|robots\.txt(.)*)
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.+)$ index.php?url=$1&%{QUERY_STRING} [L]
    </IfModule>

    <IfModule mod_deflate.c>
    <FilesMatch "\.(js|css|ico|flv|jpg|jpeg|png|gif)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>

    RewriteCond %{HTTP_HOST} ^rsigrowers\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.rsigrowers\.com$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^/?$ "http\:\/\/rsigrowers\.com\/index\.html" [R=301,L]
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^index\.php$ "http\:\/\/rsigrowers\.com\/index\.html" [R=301,L]
     
  4. mau

    mau Staff
    Staff Member

    Joined:
    Feb 27, 2013
    Messages:
    183
    Likes Received:
    16
    @Turtleman I've opened a ticket for you to discuss about this problem and avoid exposing sensitive information about your website :)
     

Share This Page