XF 1.4 VB4 Directs Broken

Chad

Active member
Hi folks,

Imported yesterday from VB4 after 10 years of use. Finalizing everything and realized the redirect is not working. Using the documented redirect suggestion here: https://xenforo.com/community/resources/vbulletin-4-x-url-redirection.120/

They don't work at all.

Example old links from VB4

http://www.talkjesus.com/bible-study/49961-bible-alcohol.html
http://www.talkjesus.com/sermons/49866-hey-jealousy.html
http://www.talkjesus.com/bible-study/50636-prayer-worship-saints-mary-biblical.html
http://www.talkjesus.com/press-stand/50726-community-transformation.html

Basically none of the old links work.


My old htaccess from VB4 was:

Code:
RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteRule (.*) http://www.mydomain.com/$1 [L,R=301]

RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ dbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ dbseo.php [L,QSA]

## Rewrites
<ifmodule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
ReWriteRule ^entries/.* entry.php [QSA]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

</ifmodule>

## Expires
<ifModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
</ifModule>

<Files 403.shtml>
order allow,deny
allow from all
</Files>



The current one in XF root folder is:


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 500 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 /

# 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>
 
Your thread ids are the same, so you can redirect those URLs using pure rewrites:

Add these rules to the top of the .htaccess file in your web root ( http://www.talkjesus.com/ ):

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /index.php?threads/$1/ [R=301,L]

By the way, why is the forum slug now missing in XF? I'd like that re-instated and remove the index.php as it's, sloppy.

XF doesn't have forum slugs in thread URLs.

You can remove the index.php by enabling friendly URLs:

https://xenforo.com/help/friendly-urls/
 
Hey just a note, having a hiccup here

One of the sub-forums shows up like this link (and 404) after I enabled frienldy URLs

http://www.talkjesus.com/#bible-chat.4

Possible conflict with your old vB forum which was in the same directory. Do you have another index file in the web root besides index.php? Or maybe vB's .htaccess file is in play.

Or try enabling this option to change those category links:

Admin CP -> Home -> Options -> Node & Forum List -> Create Pages for Categories
 
Do you have another index file in the web root besides index.php

Actually, yes. index.html only for my members/guests (placeholder while I finalize my XF install, config). But would that cause this? I'm thinking no,

Another example: http://www.talkjesus.com/#general-lounge.8

This is the current .htaccess

Code:
RewriteEngine On
RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /index.php?threads/$1/ [R=301,L]

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 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 /

    #    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>
 
Good grief...

Now it added the /forum/ slug to talkjesus.com/forum/ after I enabled that. Normal? Can we remove the slug while keeping the "create pages" enabled?
 
Back
Top Bottom