Forums

rewrite to /index.php (3 posts)

  1. henkmsncam
    Member
    Posted 3 years ago #

    Hi,

    Q: I need a rewrite of http://www.domain.com to http://www.domain.com/index.php

    Why: I show random posts on my blog and I installed 1blogcacher. I added "index.php" to the denied list of pages for caching. When I access http://www.domain.com/index.php then I DO see a random post, when I access http://www.domain.com then I see the cached website (and NO random posts).

    I added

    RewriteEngine On
    RewriteRule ^ /index.php [R=301,L]

    to the .htaccess but then it is giving a loop error.

    Please advice!

  2. BernardBorealis
    Member
    Posted 3 years ago #

    Try this:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com$
    RewriteRule ^$ http://domain.com/index.php [L,R=301]

  3. henkmsncam
    Member
    Posted 3 years ago #

    Sir,

    I do see when I enter domain.com that it gets replaced by http://www.domain.com but I dont see the http://www.domain.com/index.php ?
    I copied it exactly.

Topic Closed

This topic has been closed to new replies.

About this Topic