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

Want to use Full Friendly URLs, but

#1
I don't understand how to get them working. I've already asked my host about them, and they said that mod_rewrite is fully supported. I did some searching before making this topic and I saw that Brogan said to simply enable FFURLs first; I did so and they didn't work, so I'm here for some guidance now. What EXACTLY has to be edited or changed, and what has to be where in order to get this to work? What has to be done with .htaccess?
 

Brogan

XenForo moderator
Staff member
#2
All you should need to do is enable it in the ACP.

The .htaccess file is already configured to deal with them.

Have you checked the option in the ACP -> Search Engine Optimisation (SEO): Use Full Friendly URLs

What error are you getting?
 
#3
I'm getting a 404 Not Found error when I click on and attempt to enter a node, for example. It'll give me an error and say something like "The requested URL /forums/news-updates.4/ was not found on this server."
 

Brogan

XenForo moderator
Staff member
#4
Are you sure the .htaccess is in place in your installation directory?

Some FTP programs don't transfer them as it's a hidden file.
 
#5
Yes, on my FTP program (Transmit) I have show hidden files enabled, and I can see it sitting in the forum's directory, which happens to be the root directory.

Don't know if it's worth mentioning, but the board index url works and it doesn't have index.php at the end.
 

CyclingTribe

Well-known member
#6
Can you copy and paste your .htaccess file so we can take a look at the rewrite rules - make sure they're in there?

Also, what is the full path to your XF installation, and what (full path) directory is the .htaccess file placed in?

Also, what are the permissions of the .htaccess file and is the file ownership/group setting the same as the other files in that directory?

Cheers,
Shaun :D
 
#7
XF and the .htaccess file are both in the root directory (public_html).

As for the permissions, .htaccess has 644 as its permission and I'm not too sure what you mean by file ownership. This is my .htaccess file (I have parked domains/redirects in place)

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^chatbase\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.chatbase\.org$
RewriteRule ^/?$ "http\:\/\/www\.chathold\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^chatbase\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.chatbase\.org$
RewriteRule ^forum\.php$ "http\:\/\/www\.chathold\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^chatbase\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.chatbase\.org$
RewriteRule ^index\.php$ "http\:\/\/www\.chathold\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^chathold.com$
RewriteRule ^/?$ "http\:\/\/www\.chathold\.com\/" [R=301,L]

RewriteCond %{HTTP_HOST} ^chathold.net$
RewriteRule ^/?$ "http\:\/\/www\.chathold\.com\/" [R=301,L]
 

Brogan

XenForo moderator
Staff member
#8
That's not a standard XenForo .htaccess file.

This is:
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

    #    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) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
#9
Are you referring to the .htaccess.txt? If so, this is what is in that file:

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

    #    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) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
#11
Updated the post above. As for the .htaccess file, that's the only one I have aside from the one that came with XF. The post above yours contains the htaccess file that came with XF.
 

Brogan

XenForo moderator
Staff member
#12
Your .htaccess file needs to contain the rewrite rules I posted above.

Any additional rewrite rules you have for parked domains, etc. must come before the XenForo rewrite rules.
 
#13
I think our files are identical, by the looks of it...

So are you saying that both the .htaccess file and the htaccess.txt file should both be in one file named .htaccess? Because the file you posted above is named htaccess.txt. This is a picture of my directory, in the attachment:
 

Attachments

Brogan

XenForo moderator
Staff member
#14
The .txt file is just a backup and has no relevance as far as the functionality is concerned.
It can safely be deleted from the server.

The .htaccess (note the file has no name, just an .htaccess extension) file must contain the rewrite rules I posted above.

The file I posted above is the .htaccess file, not the htaccess.txt file.