Exclude a directory for redirect

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Exclude a directory for redirect

Postby dam8u » Mon Jul 11, 2011 10:59 pm

Hey,

I’ve tried every rendition I can think of for 2 straight hours to get my site to redirect all traffic except one directory:
/feed/

I can't get this to work on wordpress. Here is the simple rules that I have:


Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/feed/
RewriteRule ^/(.*)$ https://mydomain.com/$1 [NC,R=301,L]


This forces all traffic to https. What gives? (pulling my hair out)

I'm trying to expose my blog rss feed without a redirect to https.

Thanks,
David
dam8u
 
Posts: 1
Joined: Mon Jul 11, 2011 10:54 pm

Advertisement

Re: Exclude a directory for redirect

Postby dcz » Wed Jul 13, 2011 7:36 am

Try :
Code: Select all
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/feed/
RewriteRule ^/(.*)$ https://mydomain.com/$1 [NC,R=301,L]

Or:
Code: Select all
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteCond %{REQUEST_URI} !^/feed/
RewriteRule ^/(.*)$ https://mydomain.com/$1 [NC,R=301,L]


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Re: Exclude a directory for redirect

Postby roseflower » Sat Jul 23, 2011 2:30 pm

thanks for such valuable info

cheers
roseflower
 
Posts: 2
Joined: Sat Jul 23, 2011 2:26 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests