Codeigniter - getting 404 Not Found error

前端 未结 9 1788
慢半拍i
慢半拍i 2021-02-20 02:26

We have two hosting packages at godaddy. Our live website is working fine using following .htaccess file. Website is accessible without using index.php in url.

R         


        
9条回答
  •  我在风中等你
    2021-02-20 02:52

    Follow this

    • Create a new .htaccess file in your public_html/Project root
    • Paste the following code

      RewriteEngine on
      RewriteBase /
      RewriteCond $1 !^(index\.php|resources|robots\.txt|static) [NC]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/?$1 [L,QSA]
      

    • Optional

    If you can ssh into the server using command ssh username@ip_address on a command line either Linux terminal or Putty

    The username is the one given to you by GoDaddy or you can use root

    The ip_address would be the Public IP to your host you can find it in your hosting panel

    Run the command sudo a2dissite 000-default

    The command disables the default apache config that handles request

    Goodluck!

提交回复
热议问题