Score:0

apache ubuntu 18.04 ads trailing slash at the end automatically

gw flag

first i enabled mod rewrite then i used in my .htaccess this

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

virtual hosts file is a standard installation of LAMP

ServerAdmin webmaster@localhost
DocumentRoot /var/www/webtrade

i have been trying various combinations in my .htaccess file but none worked when i access a link like domain/something it automatically becomes domain/something/ with a forward slash.

guiverc avatar
cn flag
Please be aware that Ubuntu 18.04 LTS, which was released in 2018-April (thus the 18.04) had 5 years of *standard* support life, is nearing the end of those five years. You can use `ubuntu-support-status` to confirm if your system is still *supported*. Either way, if the machine is on-line, you should plan to *release-upgrade* asap unless you plan to use ESM/Pro, but please note ESM/Pro releases are not on-topic here when standard support ends (May-2023).
in flag
Are you certain the problem is Apache and not: (0) the site code (1) the browser (2) stale cache ?
Artur Meinild avatar
vn flag
This is literally the last day (May 31st) that Ubuntu 18.04 has standard support. As of tomorrow, 18.04 is no longer supported here. Perhaps you should consider updating.
Andrei Claudiu avatar
gw flag
No. sites ok i have ported it from xampp
Score:0
gw flag

Problem solved i added the directory to apache2.conf with

<Directory /var/www/webtrade>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

and my .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php

in Ubuntu 20.04.6 LTS did a distribution upgrade from 18.04. automatic forward slash was gone Problem solved!!!

Andrei Claudiu avatar
gw flag
Please someone check my answer. Thanks
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.