1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Redirect Help Please

Discussion in 'Installation, Upgrade, and Import Support' started by Joeychgo, Nov 13, 2015.

  1. Joeychgo

    Joeychgo Well-Known Member

  2. Chris D

    Chris D XenForo Developer Staff Member

    I don't think those redirection scripts actually include forum.php hence there is nothing there to redirect. The author of those may be able to answer why.

    That said, I think you would just need to handle this with a line or two in a .htaccess file, in your web root:

    Code:
    RewriteEngine On
    
    RewriteRule ^classicmopar/forum\.php$ /classicmopar/ [R=301,L]
    
     
  3. Joeychgo

    Joeychgo Well-Known Member

    eh, didn't work Chris
     
  4. Joeychgo

    Joeychgo Well-Known Member

    can anyone help please???
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Can you paste the contents of your .htacess file?
     
  6. Joeychgo

    Joeychgo Well-Known Member

    Thanks @Brogan

    This is in the site root:

    Code:
    RewriteEngine on
    
    RewriteOptions inherit
    
    RewriteCond %{HTTP_HOST} ^forfmjbodiesonly\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.forfmjbodiesonly\.com$
    RewriteRule ^/?$ "http\:\/\/www\.forfmjbodiesonly\.com\/classicmopar\/" [R=301,L]
    
    
    This is in the forum root

    Code:
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
    
        #    This line may be needed to enable WebDAV editing with PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
    
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I don't see the line Chris suggested in the root .htaccess file.

    Have you removed it?
     
  8. Joeychgo

    Joeychgo Well-Known Member



    Yes --- I can replace it if you want
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    As it's in your XF directory, you can probably just add something like this to the XF .htaccess:
    Code:
    RewriteRule ^forum.php /classicmopar/ [R=301,L]
     
  10. Joeychgo

    Joeychgo Well-Known Member

    that doesn't work -- it just brings me to a error page

    http://www.forfmjbodiesonly.com/classicmopar/forum.php
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    It works for me in my testing.

    Where did you add it in the .htaccess file?
     
  12. Joeychgo

    Joeychgo Well-Known Member

  13. 0ptima

    0ptima Well-Known Member

    Try this

    Code:
    Redirect 301 /forum.php http://www.forfmjbodiesonly.com/classicmopar/
     
  14. Joeychgo

    Joeychgo Well-Known Member

    Thanks - but no good. Same thing
     
  15. 0ptima

    0ptima Well-Known Member

    Where is your .htaccess file ?
     
  16. Joeychgo

    Joeychgo Well-Known Member

  17. 0ptima

    0ptima Well-Known Member

    Put that line below </IfModule> int he htaccess file in your forum folder
     
  18. Joeychgo

    Joeychgo Well-Known Member


    I did. Ill do it again right now.


    Edit -- done. Here is the htaccess


    [
    Code:
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
    
        #    This line may be needed to enable WebDAV editing with PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
    
    Redirect 301 /forum.php http://www.forfmjbodiesonly.com/classicmopar/
    
     
  19. Joeychgo

    Joeychgo Well-Known Member

    Still lost.....
     
  20. Chris D

    Chris D XenForo Developer Staff Member

    Honestly I'm pretty sure one of the above should have worked so there may be some other factor at play.

    This will work though.

    Create a file named forum.php and upload it to the relevant location. That file should contain:
    PHP:
    <?php

    header
    ('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.forfmjbodiesonly.com/classicmopar');
    exit;

    ?>
     

Share This Page