Web config redirects not working where a trailing slash is involved
-
I'm having real trouble with getting working redirects in place to use on a site we're re-launching with a modified url structure.
Old URL: http://www.example.com/example_folder/
New URL: http://www.example.com/example-of-new-folder/
Now, where the old URL's have a trailing slash the web.config simply will not accept it. It says the URL can start with a slash, but not end with a slash. However, many of my URL's do end with a slash so I need a workaround.
These are the rules I'm putting in place:
<location path="example_folder/"></location>
Thanks
-
That works perfectly, thank you very much
-
The following will work for both slash and no slash,
<rule name="Test" stopprocessing="true"><match url="^example_folder"><action type="Redirect" url="/newfolder"></action></match></rule>
if not sure where to place it, see link in last post, bottom of page
-
Thanks for the response Alan.
However, the problem is with the old URL's, so where they have a trailing slash I cannot get them to redirect to any URL's of the new structure (with a trailing slash or otherwise.).
To simplify the ask, how do I put in place a 301 redirect from 'http://www.example.com/example_folder/' to some other URL?
-
i would first decide if you want a slash or not. i prefer not as when people type urls they rarly add a slash on the end.
see this page will tell you how to remove all slashes and then your redirects should work
http://thatsit.com.au/seo/tutorials/how-to-fix-canonical-issues-involving-the-trailing-slash
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
301 Redirects Showing As 307 Redirects
Hi, Our clients are adamant that they have set up 301 permanent redirects on their websites, but when we check using Screaming Frog and various online HTTP status code checkers they are showing as 307 temporary redirects. Examples;
Technical SEO | | Webpresence
http://www.lifestylelifts.co.uk/home-lifts/
http://www.terrylifts.co.uk/ Again, the client says they are seeing 301 redirects. Why are we seeing 307's? Who is right? Very puzzling, any theories would be very much appreciated 🙂 Thanks in advance. Lee.0 -
To many 301 redirects
Hi, Is there anything wrong with over 100 301 reditects on my wordpress website and how do you go about redirecting a 301 again for example abc.com redirects to bca.com now i want to redirect bca.com to ert.com any problems with this setup? Regards
Technical SEO | | ReSEOlve0 -
Panda and Large Web Presence
I'm experiencing some recent significant drops in rankings across the board for a client of mine and I suspect that it's probably related to Panda. Their internet presence features completely unique, useful, well written content by certified industry experts. Further, all content is of proper length and again serves a core purpose, providing helpful information to their viewers. Where I think things potentially go wrong is that they have around 20 micro sites in operation, including multiple web 2.0 blogs. There are also multiple sites in operation that target more specific areas of the same city. Again all of the content is unique, but they all feature content that's of the same industry and broad topic. Despite everything being 100% unique, I fear it's too excessive. Anyone know if Panda may target this type of approach even if the quality and uniqueness is appropriate?
Technical SEO | | BrandishJay0 -
301 redirect chains
Hi everyone, I've had my site for a while now and have changed the structure a number of times. I'm confident my 301's work well and am not concerned about dead ends on my site. My question is, is there a way to find 301 redirect chains? i.e. can I export my link data from webmaster tools and run it through some software that tells me how many steps my 301's are taking to get to the final page? I don't know for sure that there are long 301 chains in my link structure, but I have a suspicion and it's very hard to check by going through them manually. Thanks in advance Will
Technical SEO | | madegood0 -
How to block my web from SeoMOz Crawler
Hi, I want to block mysite.com/forum from SeoMoz Crawler, how do i do that? i just want to block the forum and let the other part of my site still crawlable by seomoz. Thanks Regards
Technical SEO | | Gomu20 -
When is it safe to remove 301 redirects?
I have created over 500 301 redirects in my .htaccess file, some of them are more than 2 years old now. Should I delete them? I don't like seeing the "notices" number in crawl diagnostics so high 😞
Technical SEO | | danielshaw0 -
Is it better to delete web pages that I don't want anymore or should I 301 redirect all of the pages I delete to the homepage or another live page?
Is it better for SEO to delete web pages that I don't want anymore or should I 301 redirect all of the pages I delete to the homepage or another live page?
Technical SEO | | CustomOnlineMarketing0 -
CNAME redirect for Press Releases
Our company is moving our press release section over to Business Wire. Business Wire will be hosting the press releases on their servers http//ourcompany.newshq.businesswire.com, but we want it to display as if these are hosted on our site www.ourcompany/press-releases/. This is where our press releases are hosted now. They are recommending using a CNAME redirect to essentially mask their URL and display ours. We don't want to lose out on the search value that our press release area has built up over time. Will the CNAME redirect cause any SEO problems?
Technical SEO | | ryanwats0