Manasa
Manasa

Reputation: 187

Server is giving 404 error in the server not in the localhost if .htaccess file is written properly

cakephp/app/.htaccess

<IfModule mod_rewrite.c>
    RewriteBase /
    RewriteEngine on
    # Uncomment if you have a .well-known directory in the app folder, e.g. for the Let's Encrypt challenge
    # https://tools.ietf.org/html/rfc5785
    #RewriteRule ^(\.well-known/.*)$ $1 [L]
    RewriteRule ^$ webroot/ [L]
    RewriteRule (.*) webroot/$1 [L]
</IfModule>

cakephp/.htaccess

<IfModule mod_rewrite.c>
    RewriteBase /
    RewriteEngine on
    # Uncomment if you have a .well-known directory in the root folder, e.g. for the Let's Encrypt challenge
    # https://tools.ietf.org/html/rfc5785
    #RewriteRule ^(\.well-known/.*)$ $1 [L]
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

cakephp/app/webRoot/.htaccess

<IfModule mod_rewrite.c>
        RewriteBase /
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

mode_rewrite also enabled.Path also correct then also server is giving 404 not error.

<link href="css/bootstrap.min.css" rel="stylesheet">


    <link href="/css/metisMenu.min.css" rel="stylesheet">


    <link href="/css/timeline.css" rel="stylesheet">


    <link href="/css/sb-admin-2.css" rel="stylesheet">


    <link href="/css/morris.css" rel="stylesheet">

None of the css and js files are loading.only cakephp css is loading.I changed the ownership of the file to root and and i have give the 775 file permission to app/tmp also

Upvotes: 0

Views: 164

Answers (1)

Manasa
Manasa

Reputation: 187

I made a mistake i am new to cakephp.In cakephp all the css js files should be placed in app/webroot but i placed them root folder itself.when i placed the files in webroot www can access it.Thank you for your help.

Upvotes: 0

Related Questions