.htaccess script (v2024)

My application works fine in my local server, but after moving to Mochahosting i am not able to load any pages, all menus appear but then if i click any menu link, the same thing is seen.
I have tried differen scripts in htaccess files in project folder and api folder
This how it is:
-----------------------------------------
#/home/apismv/public_html/.htaccess
RewriteEngine On
RewriteBase /public_html/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
----------------------------------------------------
#/home/apismv/public_html/api/.htaccess
RewriteEngine On
RewriteBase /public_html/api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

Can anyone please help?

Thanks

  1. Make sure your hosting provider is also using Apache (not Nginx),
  2. Which version are you using? Since you have two .htaccess, it seems that you are using some old version.
1 Like

Thank you,
I am using phpmaker 2024

I have checked everything from hosting server side, they said, .htaccess is enabled. Additionally, directories are set to 755 and files to 644, and Options +FollowSymLinks directive are also added.

Could please help to get over this situation.
Thank you

what is the error message ?

not sure what linux flavor you are running – run:

less /var/log/apache2/error_log

then press G (capital) to goto the bottom of the file
to run realtime press shift-F, then try to run your app and see if anything appears here…

also on some linux distros, rewrite is not enable, enable by:

a2enmod rewrite

Thank you Skidmark,

I am using Mochahosting, its a shared hosting.

You may read URL Rewrite:

From v2024, there should be no need to set RewriteBase directives.

Also, you did you use the .htaccess generated by PHPMaker. You used your own with wrong settings.