IIS URL Rewrite

I need help to write a IIS 8 url rewrite to change

"https://www.ctia.org/about/the-ctia-team/someuser"

to

"https://www.ctia.org/about/the-ctia-team/staff-detail/someuser"

Basically adding "staff-detail" to all of the matching urls, as there would be different user names referenced - if that makes sense.

Thanks,

Nelson
CTIA_ITAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try:

<rule name="RewriteUserFriendlyURL1" enabled="true" stopProcessing="true">
                    <match url="^([^/]+)/([^/]+)/([^/]+)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="{R:1}/{R:2}/staff-detail/{R:3}" appendQueryString="false" />
                </rule>

Open in new window


change the action type to Redirect when necessary.
0
CTIA_ITAuthor Commented:
Ryan,  Thanks, but if we use the rule it redirects all traffic / urls to new urls containing the "staff-detail".  How can I do it so its only for the ""https://www.ctia.org/about/the-ctia-team/" containing urls?

Thanks,

Nelson
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
How can I do it so its only for the ""https://www.ctia.org/about/the-ctia-team/" containing urls?

you can simply try:

<rule name="RewriteUserFriendlyURL1" enabled="true" stopProcessing="true">
                    <match url="^about/the-ctia-team/([^/]+)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                    <action type="Rewrite" url="about/the-ctia-team/staff-detail/{R:1}" appendQueryString="false" />
                </rule>

Open in new window


customize it when necessary
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

CTIA_ITAuthor Commented:
Thanks.  Oddly enough this only works initially, so I think there is an issue with our set up and the CMS.
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try to verify your issue and get back to us cheers
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
do you need further assistance here?
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
as proposed
0
CTIA_ITAuthor Commented:
Thanks Issuer was resolved
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.