Web Analytics Made Easy -
StatCounter .htaccess add www EXCEPT to url.com/folder - CodingForum

Announcement

Collapse
No announcement yet.

.htaccess add www EXCEPT to url.com/folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .htaccess add www EXCEPT to url.com/folder

    hi, i'd like a .htaccess script that will, when a user types in myurl.com, bring him to www.myurl.com, EXCEPT if he types myurl.com/blog or www.myurl.com/blog. the reason for the exception is that the scripts i've tried somehow effect wordpress critically (after you press submit comment, u get a blank page and the comment isn't saved, along with some other anormalities). thanks
    Hrvoje
    Croatiankid designs
    Downtown host

  • #2
    Try the following mod_rewrite:
    Code:
    Options +FollowSymLinks
    
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{HTTP_HOST} !^www\.url\.com$ [NC]
    RewriteRule !^blog(/.*)?$ http://www.url.com%{REQUEST_URI} [R=301,L]

    Comment


    • #3
      thanks, that did the trick!
      Hrvoje
      Croatiankid designs
      Downtown host

      Comment

      Working...
      X