XF 2.1 What's happen if i set "Use full friendly URLs" on my XF? What i need to do to make it happen?

deslocotoco

Well-known member
Hello.

I have a basic question about this option, because i really hate the "index.php?" showing everywhere and i was looking to disable this thing, checking the "Use full friendly URLs" on XF Options.

But in the description there is a scary warning:

1564426647740.webp

I don't know what is a .htaccess file and i don't know how to configure, and don't know the implications if I'm check this option.

When i enter in the FTP my_forum_link/public_html i have this file:

htaccess.txt with the following content:

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

So, i do have the htaccess.txt file in my server, but he is ok for me check the "full friendly url" option?

My Forum is not going to "break" and consumed by hell and fire, losing all my threads, posts and everything?

I have historical threads with more than 6,5k pages, my main concern is loosing everything if i check this option.
 
If you open the Admin Control Panel home page (icon of a home in the top left of the admin control panel), scroll down the right hand side of the page - what does it say next to Server Software? If it says somewhere in there "Apache", then you are likely good to go with full friendly URLs. You would just need to check with your server host if mod_rewrite is enabled (it needs to be for .htaccess to work).

.htaccess file only tells server how to (re)format URL requests. It won't affect any data you have in your database and the .htaccess rules don't affect the admin control panel, so you won't lose access to the forum or any data.
 
Hello.

I have a basic question about this option, because i really hate the "index.php?" showing everywhere and i was looking to disable this thing, checking the "Use full friendly URLs" on XF Options.

But in the description there is a scary warning:

View attachment 207492

I don't know what is a .htaccess file and i don't know how to configure, and don't know the implications if I'm check this option.

When i enter in the FTP my_forum_link/public_html i have this file:

htaccess.txt with the following content:

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

So, i do have the htaccess.txt file in my server, but he is ok for me check the "full friendly url" option?

My Forum is not going to "break" and consumed by hell and fire, losing all my threads, posts and everything?

I have historical threads with more than 6,5k pages, my main concern is loosing everything if i check this option.

Thanks for the replies guys. I did read the Manual Brogan, but my skills are a little limited in server configurations, that's why i came here.

My software is "Nginx", and, considering the info on the manual i have to put this code somewhere inside my server configuration:

Code:
location /xf/ {
    try_files $uri $uri/ /xf/index.php?$uri&$args;
    index index.php index.html;
}

location /xf/install/data/ {
    internal;
}
location /xf/install/templates/ {
    internal;
}
location /xf/internal_data/ {
    internal;
}
location /xf/library/ { #legacy
    internal;
}
location /xf/src/ {
    internal;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass    127.0.0.1:9000;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include         fastcgi_params;
}

I did notice that i have to change the "/xf" patch, but what exactly i have to do?

My Forum is installed in the following subdomain: forum.politz.com.br or "my_forum_link/public_html".
 
if your forum is in the /public_html/ and not in a sub directory then you do need to edit your domain nginx config file and add the code you mentioned, but you must replace "/xf/" with "/"
 
Back
Top Bottom