URL Redirect

Why do you have two .htaccess files?
Does your site have a landing page?
Which one are you trying to work with/fix?
I have a .htaccess file in my root directory i have had since VB - that is where i added @Jake Bunce 's code as he directed me to, the one in my forum root public_html/.htaccess , then there is one in the community folder that was installed when uploading the Xenforo files.
 
I have a .htaccess file in my root directory i have had since VB - that is where i added @Jake Bunce 's code as he directed me to, the one in my forum root public_html/.htaccess , then there is one in the community folder that was installed when uploading the Xenforo files.
If you are using Apache, the one in the community folder will over-ride options in the root folder (if I remember correctly). The .htaccess for XenForo should be in the BASE ROOT directory of the forum.
Also, be sure that your REWRITEBASE is set correctly.
 
If you are using Apache, the one in the community folder will over-ride options in the root folder (if I remember correctly). The .htaccess for XenForo should be in the BASE ROOT directory of the forum.
When you say base root -public_html/.htaccess or public_html/community/.htaccess
 
Yes, there are multiple .htaccess files through the directories, which are required, but it's not clear which one you are/have been working with; the web root or the XF install directory.

Notwithstanding, my previous advice stands.
Take backups of both and start again, adding in the bits you need, testing as you go.
 
From what I recall when I had my site in a community folder (and was on Apache), I didn't have a .htaccess file in the community folder. I only had one in my root.

@tommydamic68, I suggest you start with this. Backup your .htaccess file in your community folder, then remove it. Backup your .htaccess file in your root directory (public_html). Then start again with this one, adding the bits as you go along and testing until it does what you require.

Oh and whilst you're at it, think about whether you really need your site in a community folder. If you don't, consider moving it to the root directory. I did this and it makes for a simpler URL structure.
 
The root of your webserver is probably the public_html/ folder. The XenForo (I assume) is located in /public_html/community.
First thing to try is setting your RewriteBase directive.
 
I had to hire a freelancer to figure this mess out. Hopefully Xenforo can help as far as ACP settings? Do these setting below have anything to do with redirect and .htaccess whatsoever @Brogan? Just dying to give the guy I hired all ammo need to get this right.


Screen Shot 2014-01-16 at 7.16.35 PM.webp
 
From what I recall when I had my site in a community folder (and was on Apache), I didn't have a .htaccess file in the community folder. I only had one in my root.

@tommydamic68, I suggest you start with this. Backup your .htaccess file in your community folder, then remove it. Backup your .htaccess file in your root directory (public_html). Then start again with this one, adding the bits as you go along and testing until it does what you require.

Oh and whilst you're at it, think about whether you really need your site in a community folder. If you don't, consider moving it to the root directory. I did this and it makes for a simpler URL structure.

So after hiring someone to fix my .htaccess issue, I am left with this. When checking my redirects at http://www.ragepank.com/redirect-check/ I get the following 404 errors - any thoughts on fixing this via .htaccess?

As you can see the redirect appears to be working properly as well as the robots.txt

http://www.sphynxlair.com/community/
http://sphynxlair.com/community/
http://www.sphynxlair.com/robots.txt

View attachment 65088

@Martok - your site has some strange results after looking at your redirects. Check out the link above and see you results. Interesting...
 
I've 'fixed' one issue (which wasn't really an issue) by doing the non-www to www redirect in my .htaccess file rather than use my control panel to do it.

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^seniorgamers\.net [NC]
RewriteRule (.*) http://www.seniorgamers.net/$1 [NC,QSA,L,R=301]


What I'm puzzling on now is how @tommydamic68, @Brogan and Xenforo's site all give 301 redirects for all index and default pages (both for www and non-www) when checked here http://www.ragepank.com/redirect-check/. I get 301 redirects for the non-www ones (as expected) but 404 errors for the www ones. I also get two 403 Forbiddens for the index.pl ones (strange, not sure why?).

I did try to get some support from my web host but they weren't any help.

Would anyone care to share how they got all 301 redirects for all of the default and index pages as well as redirecting non-www to www (or vice versa)?
 
I did it via .htaccess - if no one gives you an answer by today, I will be home tonight and give you what I have and you will have to finagle it a bit for your site. (From what I read 404 landing of these pages is really ok as yours does.) I just like them lit up in green! :D
 
I've 'fixed' one issue (which wasn't really an issue) by doing the non-www to www redirect in my .htaccess file rather than use my control panel to do it.

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^seniorgamers\.net [NC]
RewriteRule (.*) http://www.seniorgamers.net/$1 [NC,QSA,L,R=301]


What I'm puzzling on now is how @tommydamic68, @Brogan and Xenforo's site all give 301 redirects for all index and default pages (both for www and non-www) when checked here http://www.ragepank.com/redirect-check/. I get 301 redirects for the non-www ones (as expected) but 404 errors for the www ones. I also get two 403 Forbiddens for the index.pl ones (strange, not sure why?).

I did try to get some support from my web host but they weren't any help.

Would anyone care to share how they got all 301 redirects for all of the default and index pages as well as redirecting non-www to www (or vice versa)?

Here is the redirects I use, obviously your site is in the root as mine is in the community folder, so thats why you will need to finagle the redirect. Hope you can figure it out with this or at least get you in the right direct. Also you are throwing a "200" not sure that is correct.
Code:
# Directory Index
DirectoryIndex index.html index.php

# Redirect index.php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^$ http://example.com/community/$1 [R=301,L]


# Redirect index.aspx|html|php|shtml|cfm|pl
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index)\.(php?|aspx?|s?html?|cfm?|pl?)\ HTTP
RewriteRule ^(([^/]+/)*)(default|index)\.(php?|aspx?|s?html?|cfm?|pl?)$ http://www.example.com/$1? [R=301,L]
 
Top Bottom