I am working on a project and I’m trying to do a URL rewrite in the root of my website. The .htaccess as it is now is as follows
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L]
RewriteRule ^screenshot-of-the-week/screenshot/([^/]+) /screenshot-of-the-week/screenshot/index.php?id=$1
Rewrite is enabled on my site. I have checked the code through htaccess tester and it shows the correct values.
Yet when I visit screenshot-of-the-week/screenshot/123 for an example, I get a 404 page. When I visit screenshot-of-the-week/screenshot/ it works just fine.
Also, when going to the "real" URL manually, it also works as expected: screenshot-of-the-week/screenshot/index.php?id=123
I can’t seem to figure out where the problem is and have tried moving the .htaccess to other folders and of course also editing the path, yet no success.
Any other troubleshooting tips anyone can give? How can I check what the redirect actually is doing in the background?
source https://stackoverflow.com/questions/76629768/htcaccess-rewrite-rule-not-working-in-any-way
No comments:
Post a Comment