Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Moved forum to subdomain - Possible to redirect with vanilla routes?

shozen1shozen1 New
edited June 2012 in Vanilla 2.0 - 2.8
  • I have moved my forum from domain.com to forum.domain.com

  • The problem is....the main website (now a store) is located at domain.com - so I do not want that redirected to forum.domain.com

  • Is it possible to redirect the pages using vanilla routes? or is that impossible now the site is on a subdomain?

  • Would it be necessary to forget about the subdomain idea and instead put the forum in a subfolder where it might be easier to redirect?

thank you

There was an error rendering this rich post.

Answers

  • Options

    Vanilla route can only redirect from it relative location. It has no control over another location.

    If you have moved, then you would have to differentiate urls between, what is currently there and vanilla type urls, which is tricky, you better brush up on your regular expressions. Unless of course the forum was located at /forum or similar.

    If you the forum is located on the web root, it would have made more sense to permanently redirect, before adding the store, it is gradual, until the search engines took hold. Only then adding the store to that location.

    grep is your friend.

  • Options
    shozen1shozen1 New
    edited June 2012

    @x00 thanks for your prompt reply as always.

    Looks like subfolder it is then. I have moved it all into domain.com/forum hoping that should be easier to redirect?

    thank you

    There was an error rendering this rich post.

  • Options
    shozen1shozen1 New
    edited June 2012

    Is there an easy way to redirect each and every page so it goes up a folder to its new location in the /forum subfolder? I want the address to actually show the new subfolder /forum right now it isnt and just showing the root. Using the following .htaccess file:

    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} domain.com
    RewriteCond %{REQUEST_URI} !subfolder/
    RewriteRule ^(.*)$ subfolder/$1 [L]
    

    Any ideas? thank you

    There was an error rendering this rich post.

  • Options
    shozen1shozen1 New
    edited June 2012

    Solution for permanent 301 redirect from root to subfolder:

    In .htaccess add the following

    RewriteEngine On
    RewriteCond %{REQUEST_URI} !subfolder/
    RewriteRule (.*) http://www.domain.com/subfolder/$1 [L,R=301]
    

    Change domain.com to your domain and subfolder to your subfolder. This will redirect all pages from root to the new /subfolder/

    There was an error rendering this rich post.

Sign In or Register to comment.