| | #1 |
| New Warrior Member War Room Member Join Date: 2008 Location: Canada...EH!
Posts: 26
Thanks: 2
Thanked 2 Times in 2 Posts
|
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.. |
| | |
| |
| | #2 |
| Active Warrior Join Date: 2011
Posts: 96
Thanks: 0
Thanked 26 Times in 25 Posts
|
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. | |
| |
| | #3 |
| Active Warrior Join Date: 2011
Posts: 96
Thanks: 0
Thanked 26 Times in 25 Posts
|
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. | |
| |
| | #4 |
| Warrior Member Join Date: 2011
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
|
@2WDHost solution should work.
|
|
All i do is code code code http://isaacoyelowo.com http://cyberletters.com http://uppersms.com | |
| |
| | #5 |
| Warrior Member Join Date: 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
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!
|
| |
|
| Bookmarks |
| Tags |
| .htaccess, blog, blog issue, code, forum, forum issue, htaccess, redirect, working |
| |