www.webdeveloper.com
Results 1 to 4 of 4

Thread: No index.html as homepage

  1. #1
    Join Date
    Oct 2011
    Posts
    54

    No index.html as homepage

    Hi,
    I don't want index.html to be loaded if someone goes to my site. Like test.com (is actually: test.com/index.html)
    I want if you go to test.com (test.com/application/models/index.php) loads.
    What should I change in my htacces file?

    I know the easy solution is to have my index.html auto redirect to that location, but I think that's not the most efficient way.


    Thanks in common,
    David

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,125
    I think you'll want something like this:

    Code:
    RedirectMatch permanent ^/$ http://www.test.com/application/models
    If that doesn't work, you'll want to try Googling for "change directory root htaccess."
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,212
    You could set up an .htaccess rewrite condition, but actually "test.com/index.html" is not the same path as "test.com/application/models/index.php". If you want "test.com/index.html" to go to "test.com/application/models/index.php", the use the .htaccess file or try a 301 Redirect.

  4. #4
    Join Date
    Aug 2012
    Posts
    26
    You will need to have .htaccess file for url rewriting. A simple line of code below with redirect URL as per your needs:

    Options +FollowSymLinks
    DirectoryIndex index.php

    RewriteEngine On
    RewriteBase /
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.askapache.com/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles