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

XF 1.1 Links Error Page when Convert vbulletin to xenforo.

#1
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
 
#7
Last edited:

Mike

XenForo developer
Staff member
#8
You will need to post in the add-on's thread. It may not support the pages in that URL structure.
 

Jake Bunce

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

Jake Bunce

XenForo moderator
Staff member
#16
(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]
 
#17
(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.





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

Last edited:

Jake Bunce

XenForo moderator
Staff member
#18
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]
 
#20
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.


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

Last edited: