Home redirect part of url if query-var exists
Reply: 1

redirect part of url if query-var exists

A.Tietz Published in 2017-12-05 11:53:54Z

I have relaunched a TYPO3 Website and have a problem with the redirects of old links listed by google. I want to redirect this:




The id 88 is fix. It still does not exists in the new site, but maybe can be added later. So I just want to redirect if the id=88 AND an itemID (any number) is in the URL. I tried this:

RewriteRule ^index\.php\?id=88&itemID= /item/item-detail/?itemID= [L]

but this didn't work ... obviously ;-)

Any idea how to solve this? Thanx in advance!

András Ottó
András Ottó Reply to 2017-12-05 12:19:12Z

You need a RewriteCond too.

You can test it here: http://htaccess.mwl.be/

RewriteCond %{QUERY_STRING} ^id=88&itemID=([0-9]*)$
RewriteRule ^index\.php$ https://www.mydomain.ac/item/item-detail/?itemID=%1 [L]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311639 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO