Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 22nd Dec 2011, 12:35 PM   #1
New Warrior Member
War Room Member
 
EvilKnevil's Avatar
 
Join Date: 2008
Location: Canada...EH!
Posts: 26
Thanks: 2
Thanked 2 Times in 2 Posts
Arrow
MY Blog & Forum NOT working after .htaccess re-direct code. HELP!
Share on: 
fb share twitter share gplus share more share

Hello everyone,

I have been fighting with getting proper redirect code to point all 'non-www' versions of my website to 'www'.

I used rediect code in the .htaccess file to accomplish that, HOWEVER, now my WP blog which is set up like this http://www.examplesite.com/blog will NOT work! All it does it show a listing of the directory!? It shows all the files and that is it.

Here is the redirect code I am currently using in the root directory of the main website.

------------------------------------------------------------------------
DirectoryIndex index.htm
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.examplesite\.com$ [NC]
RewriteRule ^(.*)$ http://www.examplesite.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} /index\.htm [NC]
RewriteRule ^(.*/)?index\.htm$ /$1 [R=301,L]

IndexIgnore *

------------------------------------------------------------------------

Also, the same is true for my Forum which is also under its own directory, it just shows the files under that directory and no longer shows the forum?

What have a I done? How can I change it back?

I appreciate the help...

Thanks..

EvilKnevil is offline  
Unread 22nd Dec 2011, 01:02 PM   #2
Active Warrior
 
2WDHost's Avatar
 
Join Date: 2011
Posts: 96
Thanks: 0
Thanked 26 Times in 25 Posts
Default
Re: MY Blog & Forum NOT working after .htaccess re-direct code. HELP!
Share on: 
fb share twitter share gplus share more share

Hi.

Remove/comment all the .htaccess directives starting with "Rewrite" and try the following code:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^examplesite.com$ [NC]
RewriteRule ^(.*)$ http://www.examplesite.com/$1 [L,R=301]

2WDH.com: Professional cPanel Hosting since 2003
Really helpful support. You're not a number to us! Programming, database and site development help.
No overselling. SSD. Real 99.99%+ uptime. Free 2-week trial: no obligation/credit card required.
2WDHost is offline  
Unread 22nd Dec 2011, 01:10 PM   #3
Active Warrior
 
2WDHost's Avatar
 
Join Date: 2011
Posts: 96
Thanks: 0
Thanked 26 Times in 25 Posts
Default
Re: MY Blog & Forum NOT working after .htaccess re-direct code. HELP!
Share on: 
fb share twitter share gplus share more share

About your directory listing and forum/blog problem:
Remove/comment the DirectoryIndex and IndexIgnore directives and add the following line to the top of your .htaccess:
Options -Indexes

2WDH.com: Professional cPanel Hosting since 2003
Really helpful support. You're not a number to us! Programming, database and site development help.
No overselling. SSD. Real 99.99%+ uptime. Free 2-week trial: no obligation/credit card required.
2WDHost is offline  
Unread 24th Dec 2011, 05:46 AM   #4
co
Warrior Member
 
Join Date: 2011
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: MY Blog & Forum NOT working after .htaccess re-direct code. HELP!
Share on: 
fb share twitter share gplus share more share

@2WDHost solution should work.

co is offline  
Unread 31st Dec 2011, 05:49 PM   #5
Warrior Member
 
Join Date: 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: MY Blog & Forum NOT working after .htaccess re-direct code. HELP!
Share on: 
fb share twitter share gplus share more share

I also have issues with blogs, only the index page shows. No other pages or links work. any one have a code for .htaccess file or is there someone I can hire? thanks!
tattooking is offline  
Closed Thread


Bookmarks

Tags
.htaccess, blog, blog issue, code, forum, forum issue, htaccess, redirect, working


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:23 AM.