I can access the homepage and can get the data from the database. There everything seems OK. But when I try to go to another page from my application I am redirected to 404 error page. The URL which is showing at the bottom left corner on my browser when hover the link seems ok. It is as should be.
I tried to change the .htaccess file on the server from:
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
To:
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
But it fails again. Tried different combinations. For example change RewriteBase / to RewriteBase /projectname/public/ or RewriteBase /projectname/. Still no success.
Of course, I am not sure if the .htaccess is the problem. May be something different but I have no idea what…
On localhost the application is working and everything is OK there.
Edit: After several changes that I try I finally get it working.
Here is the solution:
I leaved server’s .htaccess file as is. So it has only RewriteBase / on it.
Then on the first line of my .htaccess file (which is in the projectname/public folder) I added this:
RewriteBase /projectname/public
Now everything is working.
Solution
Leave server’s .htaccess file as is. So there is only
RewriteBase /in it.Then on the first line of application’s .htaccess file (which is in the
projectname/publicfolder) add this line: