Tuesday, April 5, 2011

PHP Redirect to Different location using Htaccess

Hi, Consider I have a url request as follows

http://www.example.com/  or  http://www.example.com

it should redirect to

 http://www.example.com/index.php/lorem/

and also for

http://www.example.com/index.php

request should keep in the same location as

http://www.example.com/index.php

Thanks

From stackoverflow
  • Your question doesn't really make sense, but:

    Redirect 301 / /index.php/lorem/

    PHP and .htaccess aren't related.

  • Is this just a question about mod_rewrite rules in .htaccess?

  • Try This
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php/$1 [QSA]

0 comments:

Post a Comment