One little part of htaccess rewrites not working. Help!

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2007, 02:39 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 28
So I've got the main htaccess file implemented, and all of the rewrites work fine except for the following. I've actually used mod_rewrite a lot and am pretty familiar with the syntax and how it works, so this has me stumped.

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

As far as I can tell this should redirect http://mysite.com to http://www.mysite.com but it just doesn't. But as I said all the other rewrites in the htaccess file work fine. Any ideas? Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-01-2007, 02:44 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: n/a
 
Join Date: Oct 2007
Posts: 4
does /upcoming/ work for you or return 404?

I have the same issue.
Reply With Quote
  #3 (permalink)  
Old 11-01-2007, 03:18 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 28
/upcoming/ works fine, and so does every other rewrite in the htaccess file. That's what has me so confused...
Reply With Quote
  #4 (permalink)  
Old 11-01-2007, 03:37 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: n/a
 
Join Date: Oct 2007
Posts: 4
mind posting your htaccess?

mine is the default one listed.
Reply With Quote
  #5 (permalink)  
Old 11-01-2007, 03:40 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 28
Mine is also the default htaccess file, with the 2 lines at the top uncommented to enable Gzip and my 2 custom Rewrite rules from the admin for all the category names.
Reply With Quote
  #6 (permalink)  
Old 11-01-2007, 03:49 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: n/a
 
Join Date: Oct 2007
Posts: 4
well, i uncommented the enable gzip and i got a error 500..aarg!
Reply With Quote
  #7 (permalink)  
Old 11-07-2007, 10:26 AM
New Pligger
 
Join Date: Dec 2006
Posts: 27
my www. redirect doesnt work either, but everything else is peachy.
woah... did i just say peachy?
Reply With Quote
  #8 (permalink)  
Old 11-07-2007, 10:57 AM
Pligg Donor
 
Join Date: Jul 2007
Posts: 286
Quote:
Originally Posted by swiper View Post
So I've got the main htaccess file implemented, and all of the rewrites work fine except for the following. I've actually used mod_rewrite a lot and am pretty familiar with the syntax and how it works, so this has me stumped.

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

As far as I can tell this should redirect http://mysite.com to http://www.mysite.com but it just doesn't. But as I said all the other rewrites in the htaccess file work fine. Any ideas? Thanks!
I had similar issue, then I was advised to changed it to:
RewriteEngine On
RewriteRule ^index\.php$ http://yoursite.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

and its working for me. Thanks
Reply With Quote
  #9 (permalink)  
Old 11-07-2007, 12:36 PM
New Pligger
Pligg Version: 9.8.2
Pligg Template: Default
 
Join Date: Oct 2007
Posts: 28
Hey cool that works for me too. Thanks!
Reply With Quote
  #10 (permalink)  
Old 04-21-2008, 05:56 PM
Casual Pligger
Pligg Version: 9.9
 
Join Date: Apr 2008
Posts: 39
Thanks! I have beta 9.9 installed, the base url rewrite didn't work but this fixes it.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg 1.0 RC4 Category Order Is Not Working argh2xxx Questions and Comments 4 04-08-2009 10:05 AM
Version 9.7 - URLMethod 2 not working for some links tglk Questions and Comments 1 01-04-2008 12:10 AM
make friendly, url method 2 aaalmost working schakal Questions and Comments 2 07-29-2007 03:46 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development