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

.htaccess guru please

#1
I'm trying to clean up a site for search: hotkeyit.com. We have two issues going on though:
  1. If I turn XenForo to "clean URLs" it simply won't work because of the root directory .htacess (I'm guessing anyway)
  2. For the non-XenForo site I want to add this for ending slashes: RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301] but then XenForo won't work at all
I know everyone's time is valuable here but if it's an easy fix, could someone please tell me what to change so I can get XenForo with clean URLs and adding slashes to the end of the non-XenForo site?

Here's the entire .htaccess from the root:
Code:
RewriteEngine On
 
# Directs www to non-www
RewriteCond %{HTTP_HOST} ^www.hotkeyit.com [NC]
RewriteRule ^(.*)$ http://hotkeyit.com/$1 [L,R=301]
 
# Removes index.php (ExpressionEngine)
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
 
# If 404s, "No Input File" or every URL returns the same thing
# make it /index.php?/$1 above (add the question mark)
 
# 301s
Redirect 301 /videos/single/counter_protoss_ffe_pt.2/        /videos/single/counter_protoss_fast_expand/
Redirect 301 /videos/single/dual_game_analysis1/            /videos/single/dual_game_analysis/
Redirect 301 /videos/single/mind_on_mutalisks/                /videos/single/how_to_use_mutalisks/
Redirect 301 /videos/single/marine_medivac_vs_zerg_build/    /videos/single/marine_medivac_vs_zerg/
Redirect 301 /videos/single/sc2_survivor_league_2/            /videos/single/sc2_survivor_league/
Redirect 301 /videos/single/nexus_first_7_gate_expand/        /videos/single/7_gate_fast_expand/
Redirect 301 /videos/single/4_baracks_reaper_pt.1/            /videos/single/4_baracks_reaper1/
Redirect 301 /videos/single/7_gate_blink_stalker/            /videos/single/4_gate_7_gate_blink_stalkers/
Redirect 301 /videos/single/raven_push_part_1/                /videos/single/raven_push/
Redirect 301 /videos/single/3_reaper_into_gold_fe/            /videos/single/3_reaper_fast_expand_to_gold/
Redirect 301 /videos/single/3_reaper_into_gold_fe            /videos/single/3_reaper_fast_expand_to_gold/
Redirect 301 /videos/single/zvz_mid_and_late_game            /videos/single/mid_late_game_transitions/
Redirect 301 /videos/single/marine_medivac_vs_zerg_build    /videos/single/marine_medivac_vs_zerg/
Redirect 301 /videos/single/4_baracks_reaper_pt.2          /videos/single/4_baracks_reaper/
Redirect 301 /videos/single/fpvod_analysis_zerg_powerhouse    /videos/single/fpvod_zerg_powerhouse/
Redirect 301 /videos/single/blink_stalkers_7_gate/            /videos/single/4_gate_7_gate_blink_stalkers/
Redirect 301 /videos/single/4_baracks_reaper_pt.2/            /videos/single/4_baracks_reaper/
Redirect 301 /videos/single/nexus_first_7_gate_expand        /videos/single/7_gate_fast_expand/
Redirect 301 /videos/single/leakfinder_xiss                    /videos/single/leak_finder_xiss/
Redirect 301 /videos/single/strategy_building_placement        /videos/single/basics_building_placement/
Redirect 301 /videos/single/3_gate_in_close_positions        /videos/single/counter_fe_3_gate/
Redirect 301 /videos/single/raven_push_part_1                /videos/single/raven_push/
Redirect 301 /videos/single/sc2sl_spanishiwa/                /videos/single/sc2_survivor_league/
Redirect 301 /videos/single/roach_baneling_ling_infestor/    /videos/single/roach_baneling_ling_infestor_transition/
Redirect 301 /videos/single/7_gate_blink_stalker            /videos/single/4_gate_7_gate_blink_stalkers/
Redirect 301 /videos/single/leakfinder_darthdeus            /videos/single/leak_finder_darthdeus/
Redirect 301 /videos/single/build_order_3_reaper_expand        /videos/single/3_reaper_expand/
Redirect 301 /videos/single/counter_protoss_ffe_pt.2        /videos/single/counter_protoss_fast_expand/
Redirect 301 /videos/single/counter_protoss_ffe            /videos/single/counter_protoss_fast_expand1/
Redirect 301 /videos/single/4_baracks_reaper_pt.1          /videos/single/4_baracks_reaper1/
Redirect 301 /videos/single/leakfinder_confusedcrib        /videos/single/leak_finder_confusedcrib/
Redirect 301 /videos/single/leakfinder_mernst              /videos/single/leak_finder_mernst/
Redirect 301 /videos/single/leakfinder_mistercatzby        /videos/single/leak_finder_mistercatzby/
Redirect 301 /videos/single/gassless_fast_expanding        /videos/single/gasless_fast_expanding/
Redirect 301 /videos/single/blink_stalkers_7_gate          /videos/single/4_gate_7_gate_blink_stalkers/
Redirect 301 /videos/single/mind_on_mutalisks                /videos/single/how_to_use_mutalisks/
Redirect 301 /videos/single/dual_game_analysis1                /videos/single/dual_game_analysis/
Redirect 301 /videos/single/build_order_the_fe_1_of_3        /videos/single/cheese_defense_pt_1/
Redirect 301 /forums/search_results/                        /forums/index.php?search/
Redirect 301 /forums/member_search/                            /forums/index.php?members/
Redirect 301 /forums/viewannounce/                            /forums/index.php?forums/announcements.9/
Redirect 301 /forums/viewforum/                                /forums/index.php
Redirect 301 /forums/viewreply/                                /forums/index.php
Redirect 301 /forums/viewthread/                            /forums/index.php
Redirect 301 /register                                        https://hotkeyit.com/users/register/
Redirect 301 /members                                          https://hotkeyit.com/users/register/
 

Jake Bunce

XenForo moderator
Staff member
#3
1) If I turn XenForo to "clean URLs" it simply won't work because of the root directory .htacess (I'm guessing anyway)
The rewrite rules in the forum directory should override the rules in the root. What problem are you experiencing with friendly URLs in XF? How aren't they working exactly? Not at all? Something else?

If may be easier for me to take a look if you are comfortable giving me FTP access.
 
#4
The rewrite rules in the forum directory should override the rules in the root. What problem are you experiencing with friendly URLs in XF? How aren't they working exactly? Not at all? Something else?

If may be easier for me to take a look if you are comfortable giving me FTP access.
I was mistaken about point 1 -- the clean URLs for XenForo works fine, was an error on my part. However, if I use the root .htaccess to force slashes on the end of URLs, XenForo won't work. Any idea on that or would you still need FTP access?
 

Jake Bunce

XenForo moderator
Staff member
#7
I was mistaken about point 1 -- the clean URLs for XenForo works fine, was an error on my part. However, if I use the root .htaccess to force slashes on the end of URLs, XenForo won't work. Any idea on that or would you still need FTP access?
I wouldn't expect that to be a problem, but try adding the red:

Code:
# Removes index.php (ExpressionEngine)
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond $1 !^/forum/.*$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
The idea here is to exclude /forum/ URLs from this rule.

If the problem persists then I can take a look if you give me FTP info.
 
#8
I wouldn't expect that to be a problem, but try adding the red:

Code:
# Removes index.php (ExpressionEngine)
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond $1 !^/forum/.*$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
The idea here is to exclude /forum/ URLs from this rule.

If the problem persists then I can take a look if you give me FTP info.
Jake you're a real bro dude, that did it. Thank you again.