Alias / Redirect

8 posts / 0 new
Last post
#1 Thu, 06/25/2009 - 21:14
pcm2a

Alias / Redirect

I would like to have http://.domain.com really map to http://domain.com/some_junk

My best guess is that this would go in the Alias and Redirects under Website Configuration, but I couldn't get it to work. Probably something wrong on my part. Am I in the right location for that change?

I could alternatively do it in Zoneedit, but I'd rather keep things serverside.

Thanks!

Fri, 06/26/2009 - 13:40
ronald
ronald's picture

That does seem to be the appropriate location, haven't used it myself though. I usually do a php redirect as it's faster.


1. <?php
2. header("Location: http://www.site.com/some_junk"); /* Go to target */
3. exit; /* Do not execute anything below this line */
4. ?>

Fri, 06/26/2009 - 08:37
ronald
ronald's picture

hm code gets messed up per haps cite is better

1.

<?php
 
   2. header("Location: http://www.site.nl/"); /* Stuur de browser naar www.site.nl */ 
   3. exit; /* Zorgt ervoor dat de overige code niet wordt uitgevoerd */ 
   4.
?>

Fri, 06/26/2009 - 11:22 (Reply to #3)
Joe
Joe's picture

code tags are the right way to go, but you do have to switch to "Filtered HTML" rather than Markdown, for it to get it right, I think. (But maybe even that has troubles. I haven't yet figured out how to make the link-maker not run within code blocks. Still looking into it.)

--

Check out the forum guidelines!

Fri, 06/26/2009 - 13:41 (Reply to #4)
ronald
ronald's picture

nope, just edited and switched to filtered html. still not good.

Fri, 06/26/2009 - 08:41
ronald
ronald's picture

that's messed up too, how about as-is?

<div class="codeblock"><pre><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; <br />&nbsp; header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Location: http://www.site.nl/some_junk"</span><span style="color: #007700">);&nbsp; <br />&nbsp;&nbsp;&nbsp; exit; <br />&nbsp;&nbsp;&nbsp; <br /></span><span style="color: #0000BB">?&gt;</span></span></code></pre></div>  
Fri, 06/26/2009 - 11:16
pcm2a

oh crud, I didnt realize that it stripped out some of my text.

I want to have http://word.domain.com/ redirect to http://domain.com/junk/. I put "word" in < > and it stripped them out.

I don't think you can do that with a php redirect can you?

Fri, 06/26/2009 - 13:40
ronald
ronald's picture

sure you can.

just put an index.php with above php code in word.domain.com ... it will then redirect server-side

Topic locked