XF 2.2 Post VB 4.x -> XF 2.2 conversion redirect issue

Rhody

Well-known member
I converted my last VB4 forum over to Xenforo 2.2 yesterday, and am stumped on an issue.

Everything is otherwise fine, and it was a very smooth transition.

My concern is with redirection of the former VB opening filename, which most users have bookmarked. forum.php This is opening day and our users are getting redirected to a broken page.

When someone goes to ourdomain.com/forum.php or www.ourdomain/forum.php , it is redirecting them to www.www.ourdomain.com/index.php (it is adding an extra "www" to the mix, and failing)

I am using the default .htaccess file that XF installed, with Litespeed server, Litespeed cache add-on installed (does it either way), php 7.4.11, in root folder.

The provider added some code to the default .htaccess file, which I'm including here.

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 /

    #    This line may be needed to workaround HTTP Basic auth issues when using 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>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php74†package as the default “PHP†programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-alt-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 90
   php_value max_input_time -1
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/opt/alt/php74/var/lib/php/session"
   php_value upload_max_filesize 5M
   php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 90
   php_value max_input_time -1
   php_value max_input_vars 1000
   php_value memory_limit 128M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/opt/alt/php74/var/lib/php/session"
   php_value upload_max_filesize 5M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit

Any help appreciated, to get rid of the extra www.

Mike
 
Thank you for replying

Yes and that doesn't seem to change anything. It still adds an extra www. (although it does try to redirect to the root location)
 
The additional www must be coming from somewhere else - I don't see anything in that .htaccess file which would cause it.
Check httpd.conf.

Is there a reason you removed the # from the RewriteBase / line?
 
I just did it while troubleshooting, and forgot to put it back. I since have, and it still does it with that line commented out.

I have another Xenforo on the SAME server (different domain/account), that doesn't do this.

I'll put a support ticket in with the host, in case it is something on their end.

Thank you
 
MDDHOSTING was able to help me with this, in case anyone else runs into the same problem and came from a VB conversion that had a different php page that your users have bookmarked:

RewriteCond %{HTTP_HOST} ^ourdomainname\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ourdomainname\.com$
RewriteRule ^forum\.php$ "https\:\/\/www\.ourdomainname\.com\/index\.php" [R=301,L]
 
Top Bottom