Moving Vanilla to a new folder and using htacess to redirect audience

Dear friends, I would need a little help from the experts.


My old forum version is located at folder "forum2018" and I'm moving it to other folder "v01", both are located just under the www root folder.

Point is a lot of "old" links were sent out and obviosly I wouldn't like to loose audience with 404 error page.

I thought using htaccess to redirect from http://cegvforum.com/forum2018/ to http://cegvforum.com/v01/ but I'm not sure if I should alter only the root's folder htacess file and/or htaccess inside vanilla's root folder.

I got some htaccess rewritecond examples but none worked so far. Another alternative would be addressing the issue within 404 error page but I guess htaccess would do the trick.

byw, we use short links in our setup.


Any help would be appreciated.

best regards,

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Try something like this:

    RewriteRule ^forum2018/(.*)$ /v01/$1 [R=301,NC,L]
    

    But do you really want to call it v01? What about "forum"? And the next time you change something, you do not change the folder but copy everything from /forum to /v01 and evrything from /v02 (if that will be the case) to /forum

    That is not only less confusing for the users, but also more SEO friendly than putting a cryptic (v01 is cryptic!) link somewhere which leads to a forum.


  • cvlloscvllos New
    edited February 5

    @R_J you're absolutelly right , as usual. I'll follow you leads. They are very welcome.

    Best & thanks a lot !

    Unfortunatelly, for some reason (maybe htaccess of vanilla folder) is not working.

    Strange is that URL is converted properly but yet I got 404 Error mentioning folder or file does not exists or htaccess rules error.

    What I did:

    **At root www folder**

    > (IfModule mod_rewrite.c)

    >   RewriteEngine On

    >   RewriteBase /

    >   RewriteRule ^forum2018/(.*)$ /v02/$1 [R=301,NC,L]

    > (/IfModule)

    **At vanilla's folder**

    > (IfModule mod_rewrite.c)

    >   RewriteEngine On

    >   # RewriteBase /v02

    >   RewriteCond %{REQUEST_FILENAME} !-d

    >   RewriteCond %{REQUEST_FILENAME} !-f

    >   RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    > (/IfModule)


    Any help will be much appreciated !

    Thanks in advance,

  • @R_J , thanks for the input !

    All set and working... I'll follow your lead !

    Thank you very much !

    Best Regards,

Sign In or Register to comment.