'Htaccess URL rewrite with get parameters
so I've recently changed my website's file structure a little bit and now need to redirect my old URLs to the new ones.
This is what the old URLs looked like:example.com/script?id=1&title=TitleHere
the script.php is now in a sub-folder with the name "script", so the new URL is:example.com/script/1/TitleHere (This one is already working, but I still need my old urls to redirect to this pattern.)
This is what I tried in my htaccess:RewriteRule ^script?id=([0-9]+)&title=(.*) /script/$2-$1 [L,R=301]
Not sure if this is of importance but I am also using these htaccess settings:
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
Sadly my attempt didn't bring me any success, it's just throwing a 403 and I think that's because a folder named "script" already exists but I am not sure. Help would be highly appreciated!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
