skip to Main Content

i have my .htaccess file here..

RewriteEngine On
RewriteBase /faith/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]

RewriteBase /faith/ is the main folder on my local… but my problem is when i upload it in the cpanel i dont have any idea on how to use the url as my index.php .. i tried to search for it and it says that i need to change the rewritebase in a url.. but that doesn’t seems to work cause what i want is my index.php will be a url.

my login page is index.php

and i want it to become sample.com so whenever i search it the only thing that i need to do is to type sample.com

2

Answers


  1. your script seems ok in .htaccess file, you just need to use the redirection file name just like you are using index.php , you can use sample.php overthere.

    RewriteEngine On
    RewriteBase /faith/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.+)$ sample.php?uri=$1 [QSA,L]
    
    Login or Signup to reply.
  2. Just add this line at top of your .htaccess:

    DirectoryIndex index.php
    

    This will load index.php by default when you visit http://example.com

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search