XF 1.1 Links Error Page when Convert vbulletin to xenforo.

nguyenhuuhung

Active member
I have several questions related to the transition from vbb to XenForo

I need your help


When I use vbulletin.

old Links Page:

http://domain.com/showthread.php?id../page2

Now.

New Links Page when I use xenforo.

http://domain.com/threads/....id/page-2

They differ at "
- "

So. Links are dead when I share


CLick : http://domain.com/showthread.php?id../page2

Error will occur " The requested page could not be found. "

Now I have to do to when clicked Link

http://domain.com/showthread.php?id../page2

Will automatically switch to

http://domain.com/threads/....id/page-2
 
Last edited:
The ids are the same so you don't need the redirect scripts.

Add this to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
 
(to replace the old code I posted)

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
 
(to replace the old code I posted)

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]

XenForo - Error
The requested page could not be found.


11111-png.52576



My .htaccess


PHP:
#    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 /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]
        RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*/page([0-9]+)$
        RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
        RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
        RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
</IfModule>
 

Attachments

  • 11111.webp
    11111.webp
    55.3 KB · Views: 71
Last edited:
Again, that's a different URL. That's why I ask for specific and real URLs, not just examples of the same form. Here is new code to account for that third kind of URL:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%4? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
 
Again, that's a different URL. That's why I ask for specific and real URLs, not just examples of the same form. Here is new code to account for that third kind of URL:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%4? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]

I tried

URL http://domain.com/showthread.php?15 And http://domain.com/showthread.php?15-i-love-jake redirected success successfully
But. URL http://domain.com/showthread.php?15/page2 redirected failure

I think it is an error

Can You helped me thoroughly checked??

old URL: http://domain.com/showthread.php?15/page2
New URl: http://domain.com/threads/.15/page-2

If this URL is redirected

URL http://domain.com/showthread.php?15-i-love-jake/page2 will also work

Because

URL http://domain.com/showthread.php?15 And http://domain.com/showthread.php?15-i-love-jake.

They is One.


XenForo - Error
The requested page could not be found.
1111111-png.52697


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
      
        RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?/page([0-9]+)$
        RewriteRule ^showthread\.php$ /threads/%2/page-%4? [R=301,L]
        RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)(-.*)?$
        RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]

    #    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>
 

Attachments

  • 1111111.webp
    1111111.webp
    40.2 KB · Views: 54
Last edited:
Back
Top Bottom