Home Button/Icon Redirecting Incorrectly - Page Not Found

I have created my project, and generated it - all worked well. Testing it on Windoze, running Apache2.4, PHP 7.4, PostgreSQL, it works fine, however when I copy my project over to my Ubuntu Linux (20.04) box (running Apache2.4, PHP 7.4, PostgreSQL) I get the following error:HTTP 500 ERROR (in debug mode)When I “inspect” the element (Home Icon, top right of the body of the page), the tag href property is:

  • on Windows: href=“/myproject/index”
  • on Ubuntu: href=“/index”

On Windows it is working fine, i.e. redirecting as it should when clicked.
On Ubuntu it throws an error: “Page Not Found”, but when I edit the
element and remove the “index” from the the property, i.e.: href=“/” it works fine and redirect as it should.My project (on my Windows dev machine) is setup as follows in the Generate Tab:

when trying to logout, I also get the HTTP 500 error (and the system does not log me out.ERROR:
An internal error has occurred while processing your request.

You may check the .htaccess for your Linux server, see the last post in https://discourse.hkvstore.com/t/migrating-to-v2022/655/1

Ok, so here goes. W.r.t. the loaded modules, here is what is loaded (when checking “info.php”):

  • PHP Version 7.4.3
  • Loaded Modules: core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_deflate mod_dir mod_env mod_filter mod_mime prefork mod_negotiation mod_php7 mod_proxy mod_proxy_http mod_proxy_wstunnel mod_reqtimeout mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status mod_wsgi

And the .htaccess file:

RewriteEngine On
RewriteBase /myproject/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

And my Virtual Host config:

<VirtualHost *:80>
## removed comments

	ServerAdmin webmaster@mywebsite.com
	ServerName myproject.mywebsite.com
	ServerAlias www.myproject.mywebsite.com
	DocumentRoot /var/www/mywebsite.com/myproject

## removed comments...

	<Directory /var/www/mywebsite.com/myproject/>
		DirectoryIndex index.php
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
		Require all granted
	</Directory>

</VirtualHost>

Still no luck. I do know it is a configuration issue, I’m just missing something somewhere.

WABez wrote:

RewriteBase /myproject/

Are you sure the base path of your project on the Linux server is /myproject/? If you run at the root of the website (e.g. http://mysite/), then the RewriteBase should be / only.

arbei wrote:

WABez wrote:

RewriteBase /myproject/

Are you sure the base path of your project on the Linux server is > /myproject/> ? If
you run at the root of the website (e.g. > http://mysite/> ), then the RewriteBase
should be > / > only.

My bad Arbei, I have tested with “RewriteBase /myproject/” and got the following error:Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.I used “RewriteBase /” and then when I test, the pages load, but when I click on the “Home” button, I get the following error:Not Found
The requested URL was not found on this server.as it uses the following URL: mywebsite.com - This website is for sale! - mywebsite Resources and Information. (or simply /index), however when I remove “index” from the URL, i.e. http://myproject.mywebsite.com/ (or simply /) then it works fine. I therfore inspected the element and found the tag “href” property is href=“/index”. I then remove the “index” part of the property, i.e. href=“/” and it works fine.On Windows, with RewriteBase / it fails to load the page, with a page Not Found error, however without RewriteBase / it works just fine.On Linux, with OR without RewriteBase / if fails to load the page. If I manually remove “index” in the tag “href” property (as above), it works.

Ok, I have found a work-around and solved my issue by adding a Redirect statement to my Virtual host:Added this line: Redirect “/index” "/"So my Virtual Host configuration file now looks like this:<VirtualHost *:80>removed comments

ServerAdmin webmaster@mywebsite.com
ServerName myproject.mywebsite.com
ServerAlias www.myproject.mywebsite.com
DocumentRoot /var/www/mywebsite.com/myproject

Redirect "/index" "/"

removed comments…

<Directory /var/www/mywebsite.com/myproject/>
	DirectoryIndex index.php
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	allow from all
	Require all granted
</Directory>