Forum Moderators: phranque
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} blogspot\.com [NC,OR]
RewriteCond %{HTTP_REFERER} slashdot\.org
RewriteRule ^/(.mysite.com.example.net:8080*)$ http://%mysite.com.example.net:8080$1 [R]
However, referrers from blogspot aren't redirected.
Have I missed something?
[edited by: jdMorgan at 2:03 pm (utc) on April 7, 2006]
[edit reason] Example.com [/edit]
If the syntax was correct, it appears that the code would redirect to the same port at the same domain, appending that domain and port as a 'page' URL, therefore accomplishing nothing but causing your server to get stuck in a redirection loop, while making the URL longer and longer. This would increase, rather than decrease, your server load.
So, it's not at all clear what you are trying to accomplish. A list of domains, ports, and URLs that should and should not be redirected, and the URLs to which those redirects are desired, would be most helpful. Please use example.com or example.net as the domain.
Also, the correct syntax varies depending on where you put this code, so please state whether this is for use in .htaccess, httpd.conf, or conf.d.
JIm
What I'm trying to accomplish is redirecting all referers from blogspot/slashdot to the coral cache
mirror of my page, as explained here. [en.wikipedia.org...]
What would be the correct .htaccess rewrite rule to accomplish that?
RewriteRule ^/(.mysite.com.example.net:8080*)$ [%mysite.com.example.net:8080$1...] [R]
This is wrong, but I can't tell you what may be right without more information.
So where [what URL(s)] do you want to redirect from, and where [what URL(s)] do you want to redirect to?
Jim