Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I had urls with /content/ prefix e.g. mysite.com/content/bla-bla-bla/ now I whant redirect all to mysite.com/bla-bla-bla/ without /content/ Is this possible? Thanks!

share|improve this question
2  
Apache? IIS? NGINX? What software? Can you use Rewrites? Need more info –  sam Jun 15 '11 at 21:57
add comment

migrated from serverfault.com Jun 16 '11 at 2:09

This question came from our site for professional system and network administrators.

1 Answer

It is possible -- but you need to tell at least which web server do you use.

For Apache this can be achieved with the following rule (using mod_rewrite):

RewriteEngine On
RewriteRule ^content/(.+)$ /$1 [R=301,NC,L]

If you are using Microsoft IIS7.x then it is also possible with the help of URL Rewrite Module (you may need to download and install it separately -- depends which IIS version you have):

<rule name="redirect /content/" stopProcessing="true">
    <match url="^content/(.+)$" />
    <action type="Redirect" url="/{R:1}" />
</rule>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.