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

XF 1.5 Problems with rewrite url from vBSEO

#1
Hi,

i've imported my forum from vBulletin 4.x and here I used vBSEO for rewriting my urls.

Now, I used this tool to get the rules for my .htaccess to get the redirects from the old topics to the new: http://tools.geekpoint.net/xfseo/ but after I inserted this rules in the .htaccess and uploaded the redirection script found at this link https://xenforo.com/community/resources/vbulletin-4-x-url-redirection.120/ I'm getting strange behaviours in my forum, like:

- Admin CP stops to work: seems that it can't get jQuery anymore.
- Some topics redirects to forum sections
- Some pages of topic lists of forum doesn't work

This is my 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>
And this is the rules generated by the tool:

Code:
RewriteRule [^/]+/.+-([\d]+)-pagina([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/.+-([\d]+).html showthread.php?t=$1 [NC,L]
RewriteRule [^/]+-([\d]+)-pagina([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
RewriteRule [^/]+-([\d]+) forumdisplay.php?f=$1 [NC,L]
 
#3
Where are you placing the rules?
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On

        RewriteCond %{HTTP_HOST} !^www\.sciax2\.it$
    RewriteRule ^(.*)$ http://www.sciax2.it/forum/$1 [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 /forum

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        #RewriteRule ^(js)($|/) - [L]
        #RewriteRule [^/]+/.+-([\d]+)-pagina([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
        RewriteRule [^/]+/.+-([\d]+).html showthread.php?t=$1 [NC,L]
        #RewriteRule [^/]+-([\d]+)-pagina([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
        #RewriteRule [^/]+-([\d]+) forumdisplay.php?f=$1 [NC,L]

    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>
 

Mike

XenForo developer
Staff member
#4
Your forumdisplay.php related rules are likely the problem as they're very generic. What are some example URLs they are supposed to be matching?
 

Mike

XenForo developer
Staff member
#6
You can try this, though untested:
Code:
RewriteRule ^[^/]+-([\d]+)$ forumdisplay.php?f=$1 [NC,L]