Xenforo Friendly URL

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Norska

Java Developer (https://norska.dev)
Supreme
Feedback score
68
Posts
901
Reactions
1,407
Resources
14
Edit .htaccess, put the following in, just obviously change google.com to your domain:
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
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 
    #RewriteCond %{SERVER_PORT} 80
    #RewriteRule ^(.*)$ https://www.google.com/$1 [R,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>

RewriteCond %{HTTP_REFERER} !^http://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .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 php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 156M
   php_value post_max_size 18M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 15M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
 

Astroh

Banned
Feedback score
0
Posts
161
Reactions
42
Resources
0
Edit .htaccess, put the following in, just obviously change google.com to your domain:
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
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 
    #RewriteCond %{SERVER_PORT} 80
    #RewriteRule ^(.*)$ https://www.google.com/$1 [R,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>

RewriteCond %{HTTP_REFERER} !^http://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.google.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://google.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .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 php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 156M
   php_value post_max_size 18M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 15M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
I am not using cPanel. I am using Ubuntu 18.04 VPS
 
Banned forever. Reason: Ban Evading (ScxryGxng, https://builtbybit.com/members/scxrygxng.142440/)

Norska

Java Developer (https://norska.dev)
Supreme
Feedback score
68
Posts
901
Reactions
1,407
Resources
14
Or you just enable the feature via xenforo admin panel.

Go to options and then Search Engine Optimization. There's the option.
It usually doesn't work correctly if you don't have some specific settings set. It might look like it work but links etc. might be broken
 

Astroh

Banned
Feedback score
0
Posts
161
Reactions
42
Resources
0
It usually doesn't work correctly if you don't have some specific settings set. It might look like it work but links etc. might be broken
I am not using cPanel though...
 
Banned forever. Reason: Ban Evading (ScxryGxng, https://builtbybit.com/members/scxrygxng.142440/)

rohanmcdermott

Website Dev & GFX Designer
Premium
Feedback score
22
Posts
195
Reactions
69
Resources
0
Enable it in XenForo settings.
Change htaccess.txt to .htaccess in your web host via FTP
 

Astroh

Banned
Feedback score
0
Posts
161
Reactions
42
Resources
0
Enable it in XenForo settings.
Change htaccess.txt to .htaccess in your web host via FTP
I did it already.[DOUBLEPOST=1555102943][/DOUBLEPOST]Still not working. Can anyone help?
 
Last edited:
Banned forever. Reason: Ban Evading (ScxryGxng, https://builtbybit.com/members/scxrygxng.142440/)

Kuchy

Web Developing Cake
Support
Feedback score
14
Posts
664
Reactions
505
Resources
2
Status
This thread has been locked.
Top