I'm trying to setup mod_rewrite on a small VPS running Ubuntu 18.04 with Apache 2.4.29
I have the following structure:
root
├── index.html
├── resources
│ └── css
│ └── styles.css
├── test.php
└── tools
└── php
└── index.php
I'm using it as a hobby and learning the works of it. The issue is the following:
I've added a few RewriteRule's in apache2.conf file in /etc/apache2/
RewriteRule ^test$ /test.php [L]
RewriteRule ^php$ /tools/php/index.php [L]
The first one that rewrites /test.php to /test works without any problems. The second one that i'd wish would rewrite the entire /tools/php/index.php to a simple /php doesn't seem to work and I haven't figured out why, after countless 'solutions' found on Google.
This is the exact lines i have in the Directory tag in apache2.conf
<Directory /home/user/Work/Web/root>
Options +Indexes -MultiViews +FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
RewriteRule ^test$ /test.php [L]
RewriteRule ^php$ /tools/php/index.php [L]
</Directory>
Any help is much appreciated as I'm stuck right now and unless i stumble upon a good solution, I don't know how much it will take me to fix this.
Cheers, G.