Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » URL Rewriting

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 2553 Views
  • AJ_Trojan
    Avatar
    Community Member
    3 Posts

    URL Rewriting Link to this post

    I want to modify the .htaccess file so that the traffic directed to www.mysite.com/blog is redirected to www.mysite.com/blog/

    I tried
    RewriteCond %{HTTP_HOST} ^mysite.com/blog$
    RewriteRule ^(.*)$ http://www.mysite.com/blog/$ /$1 [r=301,nc]

    But nothin seems to work , please help.

  • lestatron
    Avatar
    Community Member
    7 Posts

    Re: URL Rewriting Link to this post

    I'm having quiet similar problem.

    While trying to do blog claim on technorati, it fails. It might be due to the reason that part of the url is being stripped by Technorati. www.domain.com/blog/ -> www.domain.com/blog
    Silverstripe redirects www.domain.com/blog -> www.domain.com/blog/?url=/blog

    Have anyone found a solution for this problem?

  • lestatron
    Avatar
    Community Member
    7 Posts

    Re: URL Rewriting Link to this post

    My workaround for the blog redirect problem
    NB! Works only with apache server rewritter

    Add the 2 following lines into .htaccess file after RewriteEngine On on line 10

    ...

    RewriteCond %{REQUEST_URI} ^/([\w_-]+)([^/]{1})$
    RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]

    ....

    2553 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.