I need to redirect links from external pages to an application into a subfolder.

My "old" links where like this:

 https://www.somepage.com/index.cfm?id=abc

Which I now have to change to:

 https://www.somepage.com/mem/index.cfm?id=abc

While I informed all users to update their links, I'm sure I will have to chase some for a while, so my idea was to try and setup a redirect server side. What I'm not sure is how to preserve the url parameter on the re-direct. Is something like this possible at all?

Thanks for some insights!

有帮助吗?

解决方案

Use the QSA (Query String Appended) to preserve the query string. Try :

RewriteEngine On
RewriteRule /index.cfm$ /mem/index.cfm [QSA,L]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top