Forum Moderators: phranque
RewriteOptions inherit
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.net [NC]
RewriteRule (.*) http://www.mysite.net/$1 [R=301,L]
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
#End Gzip
#cache html and htm files for one day
<FilesMatch ".(html|htm)$">
Header set Cache-Control "max-age=43200"
</FilesMatch>
#cache css, javascript and text files for one week
<FilesMatch ".(js|css|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
#cache flash and images for one month
<FilesMatch ".(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
#disable cache for script files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
#Redirect old affs
RewriteEngine on
RewriteBase /
RewriteRule ^aff/(.*) /CV_Writing_Services.htm [R=301,L]
RewriteEngine on
RewriteBase /
RewriteRule ^idevaffiliate/(.*) /CV_Writing_Services.htm [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.net$
RewriteRule ^Professional\ CV\.htm$ "http\:\/\/www\.mysite\.net\/ProfessionalCV\.htm" [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.net$
RewriteRule ^How\ to\ write\ a\ CV\.htm$ "http\:\/\/www\.mysite\.net\/how\-to\-write\-a\-CV\.htm" [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.net$
RewriteRule ^JobSeekerTools\.htm$ "http\:\/\/www\.mysite\.net\/blog\/" [R=301,L]
Redirect 301 /Graduate-CV-Advice.htm http://www.mysite.net/blog/graduate-cv-example-help/
Redirect 301 /NotNeededCV.htm http://www.mysite.net/GoodCV.htm
Redirect 301 /Howmanypages.htm http://www.mysite.net/GoodCV.htm
Redirect 301 /how-to-write-a-CV.htm http://www.mysite.net/GoodCV.htm
Redirect 301 /CVprofiles.htm http://www.mysite.net/GoodCV.htm
Redirect 301 /blog/have-you-ever-lied-on-your-cv/ http://www.mysite.net/blog/should-i-lie-on-a-cv/
Redirect 301 /blog/cv-embellisher-banned-for-a-year/ http://www.mysite.net/blog/should-i-lie-on-a-cv/
RewriteCond %{HTTP_HOST} ^mysite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.net$
RewriteRule ^Free\-CV\-Review\.htm$ "http\:\/\/www\.mysite\.net\/Free\-CV\-Review\.php" [R=301,L]
RewriteRule ^blog/index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule blog/ /blog/index.php [L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^Employment_gaps\.htm$ "http\:\/\/www\.mysite\.net\/blog\/medicine\-for\-a\-spotty\-cv\/" [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.net$
RewriteRule ^greatinterviewtips\.htm$ "http\:\/\/www\.mysite\.net\/blog\/10\-job\-interview\-no\-nos\/" [R=301,L]
if visiting the non-www version of the /blog directory, rather than redirecting to www.mysite/blog, it would redirect back to home?
Anyway, I resolved this by putting the non-www re-write htaccess instructions into my root directory and deleting them from the Wordpress directory.
This seemed to work; however, somehow, it keeps changing back? I have to keep manually editing the htaccess file on the blog and deleting the Wordpress instructions?
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$