The software I am working on uses ugly urls. To make it easier for users to share projects (it is a project administration package) I want to have a redirect. It should redirect projectadmin.dev/project/1234
to some other URL.
I can get this to work on ISS using their web.config files, but Apache is giving me headaches.
For demo purposes I have shortend my current .htaccess file, but it still gives the issue:
RewriteEngine On
RewriteRule ^.*project/([0-9]+)$ RandomOtherPage.php
When I access the url projectadmin.dev/project/123
it gives me an 403 (Forbidden) error. I think this happens because the folder project
exists in my project. When I change the .htaccess file to:
RewriteEngine On
RewriteRule ^.*projects/([0-9]+)$ RandomOtherPage.php
And go to projectadmin.dev/projects/123
it will work as I intended.
My question: How do I ignore the fact the project folder exist but still have the files in it accessable (eg. projectadmin.dev/projects/image.jpg
should still work) and have a working redirect with the digits?
.htaccess
file inside the/project
folder that also contains mod_rewrite directives?