Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Redirects

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1530 Views
  • KatB
    Avatar
    Community Member
    94 Posts

    Redirects Link to this post

    Since SS is not able to replicate the original URI structure, is it possible then to set up redirects in the .htaccess file that would be successful?

    eg: Redirect 301 www.domain.com/subdirectory/oldpage.html http://www.domain.com/newpage/

  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Redirects Link to this post

    yes:

    Redirect 301 /subdirectory/oldpage.html http://www.domain.com/newpage/

  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Redirects Link to this post

    I have set the redirects up in the .htaccess file before Silverstripe's block. On clicking links to the older URIs, I get the new URI with a ?url=/oldURI.html.

    Should the redirects be after the Silverstripe block? What is the best way to avoid the ?url=/oldURI.html ?

  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Redirects Link to this post

    Thanks very much to DesignCity and simon_w who helped me fix my problem on IRC ))))

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Redirects Link to this post

    Please share your solution with the forum... Someone else might need this as well..

    Thanks

  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Redirects Link to this post

    At the top of .htaccess (before the SilverStripe block) place this:
    RewriteRule Directory/File.html newURI/ [R=301,L]

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Redirects Link to this post

    Just to expand on the previous post:
    If you set up the following (using my own site as the example):
    RewriteRule social/maternity/ http://nfaw.org/paid-maternity-leave/ [R=301,L]
    RewriteRule social/ http://nfaw.org/women-s-social-policy/ [R=301,L]

    The redirects seem to work as expected. The most specific one is triggered first, followed by the more general. You can get users to the most popular entry points directly, while for other pages, they at least land in the right part of the site.

    Your web stats program should identify the most common entry points to help with this process.

    1530 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.