I migrated my old blog into WordPress, my old cms has a category URL structure like this one
https://www.example.com/search/label/health?m=0?&max-results=8
https://www.example.com/search/label/health?updated-max=2015-03-19T23:13:00-07:00&max-results=20&start=20&by-date=false
https://www.example.com/search/label/health/feed/rss2/
https://www.example.com/search/label/health
https://www.example.com/search/label/health?m=1
My new CMS has a category structure (permalink set to " No category base")
https://www.example.com/health
https://www.example.com/health/feed
https://www.example.com/health/page/1
My htaccess has modified rules for handling amp parameters taken from
Handle "amp" in URLs from a now removed WordPress plugin
# Redirect ?m=
RewriteCond %{QUERY_STRING} ^m=[01]$
RewriteRule (.*) /$1? [R=301,L]
# Redirect old "amp" URLs back to permalink
RewriteCond %{QUERY_STRING} ^(no)?amp(=[01])?$ [OR]
RewriteCond %{REQUEST_URI} /amp/?$
RewriteRule ^/?([^/]+\.html) /$1 [QSD,R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
can htaccess catch old category & tags path /search/label/123456
and redirect them into new url structure https://www.example.com/123456
# Redirect ?m=
rule only matches whenm=
is the only URL parameter (so it only matches the last example, not the first) - is that the intention?# Redirect ?m=
were taken fromhttps://stackoverflow.com/questions/32118568/how-do-i-redirect-url-parameter-m-1
( to catch?m=0 &?m=1
) ..do you see any problem with the overall htaccess?/search/label/health?m=0?&max-results=8
(I assume that second?
is a typo?), whereas it perhaps looks like it should. However, that rule is kind of trumped by the new rule in my answer anyway.