We help IT Professionals succeed at work.

change my redirect to rewrite

135 Views
Last Modified: 2017-07-28
I have this currently in my IIS web.config file.
<rule name="services" stopProcessing="true">
                    <match url="^account$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://www.oorah.org/account/public/" />
                </rule>

Open in new window


how can I change this to a rewrite that it should just stick public after the account?

I want, if you go to
www.oorah.org/account  should rewrite to www.oorah.org/account/public/
if you type
www.oorah.org/account/thezone should rewrite to www.oorah.org/account/public/thezone.

etc.
like that
Comment
Watch Question

David Johnson, CDSimple Geek from the '70s
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
a redirect is a client-side request to have the web browser go to another URL. This means that the URL that you see in the browser will update to the new URL.
A rewrite is a server-side rewrite of the URL before it’s fully processed by IIS. This will not change what you see in the browser because the changes are hidden from the user.

Perhaps
 <action type="Rewrite" url="https://www.oorah.org/account/public/" />

Author

Commented:
let me explain my question better.
is it possible that the user types in the url
www.oorah.org/account/thezone
but the page they will be shown to them with be www.oorah.org/account/public/thezone, even if their url doesn't change.

is there one redirect that can use a symbol that will always stick the public in between?
RobOwner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
can you direct me on how to interpret that into this web.config fiel?
<rule name="services" stopProcessing="true">
                    <match url="^account$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://www.oorah.org/account/public/" />
                </rule>

Open in new window

Owner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.