Okay, so I have an old page that uses a system with variable in the URL query, and I want to update that page to a new version where I have changed this information.
What I have on the old page are URLs like this: website.com/index.php?lang=en&act=art
or
website.com/index.php?act=con&lang=fr
(notice that act= and lang= may be on different spots in the query).
What I need is to redirect people getting to those URLs to the new query names.
What the new system looks like:
website.com/index.php?language=english&page=articles
or
website.com/index.php?language=french&page=contact
(notice that I need language= to be first all the time now).
This should be possible with a simple expression I belive.
#RewriteCond %{QUERY_STRING} act=(.)
#RewriteRule ^index.php(.) /index.php?page=%1 [R]
Something like this? But it’s not working out for me.
If it’s not possible or good to do it by rules, I have a list of exact URLs that I want replaced, and I’ll gladly do it manually as long as the query-strings (anything after? will be recognized and I can control it).
So what I would also do is a manual list of:
website.com/index.php?act=pre&lang=fr
to
website.com/index.php?language=francais&page=articles
The system I currently have in place is like this to fix URLs:
#4 strings = sorted categories for articles etc.
RewriteRule ^public_html/subdir/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ /subdir/index.php?language=$1&page=$2&sort=$3&id=$4
#3 strings = specific articles
RewriteRule ^public_html/subdir/([^/]+)/([^/]+)/([^/]+)/$ /subdir/index.php?language=$1&page=$2&read=$3
#2 strings = language specific pages
RewriteRule ^public_html/subdir/([^/]+)/([^/]+)/$ /subdir/index.php?language=$1&page=$2
#1 string = any page in english
RewriteRule ^public_html/subdir/([^/]+)/$ /subdir/index.php?language=english&page=$1
Anyone have any suggestions on how to fix this?
Thanks in advance,
MNeMiC