I am still having a problem with my re-write rule My objective is to remove a certain directory from a URL, how do I achieve this? For example: www.mywebsite.com/uk/editions/ should be re-written to www.mywebsite.com/editions/ ( removing the directory UK )
-
The above scenario is now working for all URLS, except one. The UK homepage is physically located here. ( index.html) http://www%20.mywebsite.com/uk/ And the correct re-write rule should display the URL as http://www%20.mywebsite.com instead it is showing the www root index.html instead of the uk/index.html page. BUT if I specify the index page within the URL like so http://www%20.mywebsite.com/uk/index.html it correctly rewrites the URL to http://www%20.mywebsite.com and shows the UK index page and not the www root index page. The rule I am using is as follows. ------------------------------------------ I am not sure what I am doing wrong. Here are my rule(s). Thanks <rule name="Hide UK Directory in URL" enabled="true" stopProcessing="true"> <match url="^uk$|^uk/(.*)$" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^www\.mywebsite\.com$" /> </conditions> <action type="Redirect" url="{R:1}" logRewrittenUrl="true" /> </rule> <rule name="Rewrite the URL after UK is hidden" enabled="true" stopProcessing="true"> <match url="^(?!uk)(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^www\.mywebsite\.com$" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="uk/{R:1}" logRewrittenUrl="true" /> </rule>
-
Answer:
You should try http://stackoverflow.com for this kind of questions.
Giovanni Olivera at Quora Visit the source
Related Q & A:
- How can I redirect www to non www site?Best solution by Server Fault
- How to write temporary files from temporary path to a temporary directory?Best solution by msdn.microsoft.com
- How do I achieve best marketing and sales as cost effectively as possible for my new business?Best solution by Yahoo! Answers
- How do I achieve flawless skin?Best solution by Yahoo! Answers
- How do i achieve my goal of being a veterinarian?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.