DS9
DS9

Reputation: 3033

how to call index.php on startup with .htaccess?

i have searching around it..but not found solution.so i posted this question.
i have a .htaccess file.i am trying to redirect website on index.php.
example: when user type demo.org/demo2/ then url redirect to demo.org/demo2/index.php. NOTE : index.php is inside demo2 directory.

.htaccess file:

DirectoryIndex index.php index.html index.htm
php_value memory_limit 200M
php_value upload_max_filesize 200M
php_value post_max_size 200M  

problem is url is not redirecting. thanks in advance.

Upvotes: 0

Views: 1004

Answers (1)

Matt R. Wilson
Matt R. Wilson

Reputation: 7575

You'll want something along these lines

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^/demo2/?$
    RewriteRule ^$ http://demo.org/demo2/index.php [L,R=301]
</IfModule>

Upvotes: 1

Related Questions