• 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

Chris D

XenForo developer
Staff member
#2
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]
 

Joeychgo

Well-known member
#3
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]
eh, didn't work Chris
 

Joeychgo

Well-known member
#6
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>
 

Brogan

XenForo moderator
Staff member
#9
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]
 

Joeychgo

Well-known member
#18
Put that line below </IfModule> int he htaccess file in your forum folder

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/
 

Chris D

XenForo developer
Staff member
#20
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;

?>