Hi, after searching the forum i could not find anything quite like this rewrite. I have a blog which is hosted in a separate folder from the rest of my website ... then this blog is used in my website using a frame.
So, my main website would be
http://example.com/mymainfolder/News_blog.html
My blog would be integrated in the above page using a iframe... In turn the source of tis iframe would be located at
http://example.com/myblogfolder/
Now the blog page available at the above folder are just bare bones... they only contain the blog without the rest of the main web site elements... no menus, no background pictures etc.
The problem is that when I access the links to my blog from an outside domain.. such as from a google search, or from posts linked in facebook, the links direct to the blog page which is completely out of context from the rest of the website (since the blog is integrated in the main website using a frame).
I would therefore like to redirect all traffic to the blog page which is coming from outside my domain to redirect to the main website (which is integrating the blog in a frame).. thus displaying it in the right and intended context.
I have initially tried to deal with this issue using REFERER rewrite rules such as
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.google.com/
RewriteRule /* http://example.com/mainwebsitefolder/Blog_news.html [R,L]
RewriteCond %{HTTP_REFERER} ^http://www.facebook.com/
RewriteRule /* http://example.com/mainwebsitefolder/Blog_news.html [R,L]
Unfortunately, the above rules had no effect whatsoever...
However, since I would like to have ALL external referers redirected, it would be better to have such a rule specified instead of having to list all the external referers one by one.
Would this be possible at all? Any help would be greatly greatly appreciated.
[edited by: incrediBILL at 5:30 pm (utc) on May 15, 2012]
[edit reason] fixed URLS, use Example.com [/edit]