SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Forums Closed Want to 301 Redirect everything to a closed message

    Forums closed due to spam and i want to redirect all the posts in from the forum to a closed message in the root.

    Example:
    http://somedomain.com/forums/tacos/i-love-beans.html
    and all content from http://somedomain.com/forums/

    should go to
    http://somedomain.com/closed.php

    I can do the folder just having issues with the content of the folder

    Thanks!

  2. #2
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Something like this perhaps?

    Code:
    RewriteEngine On
    RewriteRule ^forums/(.*) http://somedomain.com/closed.php [R=301,L]
    Might need to be tweaked a little, I'm not too good with the rewrites

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,097
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Since you're not at all interested in what's in the URL after /forums and the fact that the URL starts with "/forums" is indication enough to fire the rule, there is no need to tell the regex parser to go and match the rest of the URL (i.e., the /(.*) part), that's just doing work for nothing.

    You can use what Immerse posted, but leave out /(.*)

    (it will work with that code btw)
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •