0

I have tried commenting this line present in congif/core.php, // Configure::write('App.baseUrl', env('SCRIPT_NAME')); But when I hit my url it gives me 404 error.

2 Answers 2

2

Make sure you are loading mod_rewrite correctly. You should see something like

#uncomment it by removing leading #

LoadModule rewrite_module libexec/apache2/mod_rewrite.so 

Verify that your .htaccess files are actually in the right directories. Some operating systems treat files that start with ‘.’ as hidden and therefore won’t copy them.

 #CAKEPHP root .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

#Cakephp App directory .htacess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>

#Cakephp webroot directory .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

URL_REWRITING

Sign up to request clarification or add additional context in comments.

Comments

1

You may fix it with your web-sersver (.htaccess rules for apache, rules in configuration file for nginx).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.