Mobile app version of vmapp.org
Login or Join
Jennifer507

: This is a classic error, your rule only matches paths which literally match /testword. If you want to redirect everything that begins with /testword, remove the $: RewriteRule ^testword "http://outsidedomain.com/test.myd

@Jennifer507

This is a classic error, your rule only matches paths which literally match /testword. If you want to redirect everything that begins with /testword, remove the $:

RewriteRule ^testword "http://outsidedomain.com/test.mydomain.com/testword/" [R=301,L]


If you want to match /testword and /testword/ and nothing else, make the slash optional by adding /?:

RewriteRule ^testword/?$ "http://outsidedomain.com/test.mydomain.com/testword/" [R=301,L]




It looks like that nyanit.com opens india.thefalljourney.com/cat/ in your browser. Perhaps you're viewing a cached page in Chromium which is why the redirection is not infinite. The problem is:

india.thefalljourney.com/cat is redirected to nyanit.com/india.thefalljourney.com/cat/ http://india.thefalljourney.com/cat/ is opened in a <iframe> by nyanit.com
With the rewrite rule, india.thefalljourney.com/cat/ is rewritten again... infinite loop.


Suggestion: don't use an Apache redirect for this, but Javascript. If it's detected that the page is in a frame, do not redirect. Put the below JS code on india.thefalljourney.com/cat and remove the apache redirection code:

<script>
if (parent == self) {
location.replace("http://nyanit.com/india.thefalljourney.com/cat/");
}
</script>

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Jennifer507

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme