Forum Moderators: phranque

Message Too Old, No Replies

.htaccess redirect while removing domain HTML frame

redirect while removing domain HTML frame

         

Microshrimp

10:56 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



(I don't know how to disable URLs on here; none of them need to be clicked)

I'm not sure if this is a common thing to want to do, but here is my situation.

I have a domain name that is redirected to a web server user account on another server. The registrar does this redirection within a hidden HTML frame so that my domain name remains in the address bar after being redirected.

what shows up in the address bar as www.mydomain.com/folder1/ is actually [WebServer...]

The problem I am having is that I want to use a .htaccess file in a subdirectory of my website to redirect to another page when this directory is accessed. I used the following .htaccess in that subdirectory:

RedirectMatch / [WebServer...]

This worked exactly the way I expected it to, with one exception. The .htaccess redirection worked, but the address bar still displayed the original URL because of that registrar HTML frame I mentioned above.

For example, if I wanted www.mydomain.com to redirect to www.yourdomain.com, the .htaccess file I created would do it, but when yourdomain.com loads, the address bar will still say mydomain.com, which is not good.

So my question is: is there a way to do the .htaccess redirection AND escape the HTML frame that my registrar creates?

If I were doing a link in HTML, I would use the Target="_Blank" parameter to open a link in a new window, which does overcome the registrar's HTML frame. Is there a similar parameter for the .htaccess redirection methods?

I hope that made sense. I don't really like using the registrar masked redirection, but it's the only option that is compatible with my skill level and budget at the moment. Also, I don't know a whole lot about the various redirection methods or .htaccess, but I learn quickly when provided with easy to understand information.

Thank you!

Microshrimp

2:12 am on Sep 13, 2006 (gmt 0)

10+ Year Member



Well, I thought this might be easier with .htaccess, but while searching around I found a javascript code that seems to be solving my problem. I just created an index.html file in the directory that I want to be redirecting that contains:

<script type="text/javascript" language="JavaScript">
top.location="../../website2/";
</script>

the key here is that the parameter "top" overrides the frame from the registrar thus allowing the new location to be fully visible in the address bar.

If anyone can do this with .htaccess though, I'm still interested.

[edited by: Microshrimp at 2:14 am (utc) on Sep. 13, 2006]