need help adjusting xenforo htaccess for own use

You are forcing me to learn this stuff. :confused:

Use this .htaccess code:

Code:
RedirectMatch 301 ^/news([^_]+)_([^.]+)\.html$ /index.php?threads/$2.$1/
You could just write it as such:
Code:
RedirectMatch 301 ^/news([^_]+)_([^.]+)\.html$ /index.php?threads/$1/
That should just use /threads/threadID
 
Yeah...and i understand this.

My point is instead of redirecting it gives a 404 not found (exactly what i said :P), the code is in the htaccess file but it doesn't seem to run.
 
Your forum isn't using friendly URLs so you don't need those rewrite rules. But in my testing this redirect still works if you place it at the end of XenForo's htaccess file.
 
This is my htaccess from xenforo

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

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data|js|styles|install) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

RedirectMatch 301 ^/news([^_]+)_([^.]+)\.html$ /index.php?threads/$2.$1/

That is currently at the website root, and as you can see it doesn't work :/
 
You may need to tweak the rule slightly.
Different servers seem to handle them differently.

For example I can't use the non-www rule which is used here on xenforo.com on my server, I had to use a different one.

Edit: Never mind, looks like it's sorted.
 
Top Bottom