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?
 
Ryan ChongConnect With a Mentor Commented:
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
 
Ryan ChongCommented:
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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
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 ChongCommented:
try to verify your issue and get back to us cheers
0
 
Ryan ChongCommented:
do you need further assistance here?
0
 
Ryan ChongCommented:
as proposed
0
 
CTIA_ITAuthor Commented:
Thanks Issuer was resolved
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.