Redirection to be done

Free hosts to play with mysql and php .

Moderators: macek, egami, gesf

vijay25687
New php-forum User
New php-forum User
Posts: 3
Joined: Fri Sep 17, 2010 9:43 pm

Redirection to be done

Postby vijay25687 » Fri Sep 17, 2010 9:57 pm

Hi,

I am a novice to PHP, i need some help

This is my site address (http://www.hiatech.com).

I want my site to redirect to (http://hiatech.com).

I dont want the www to be there.

So what should i do. Please send me the code if possibe.

Thanks in advance

Mr182
New php-forum User
New php-forum User
Posts: 11
Joined: Tue Sep 21, 2010 10:58 am

Re: Redirection to be done

Postby Mr182 » Tue Sep 21, 2010 10:59 pm

Code: Select all

<?php

// at the top of page
header('Location: http://example.com');
exit();

?>

vijay25687
New php-forum User
New php-forum User
Posts: 3
Joined: Fri Sep 17, 2010 9:43 pm

Re: Redirection to be done

Postby vijay25687 » Wed Sep 22, 2010 2:13 am

Mr182 wrote:

Code: Select all

<?php

// at the top of page
header('Location: http://example.com');
exit();

?>


Hi

I already tried these codes but it shows like The page isn't redirecting properly.So that i came to the forum that what to be done.

Thankss

phpweby
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Sep 29, 2010 7:05 am

Re: Redirection to be done

Postby phpweby » Wed Sep 29, 2010 7:12 am

This isn't the right sub-forum to ask this question.

You don't have to do it using PHP. You can modify (or create) the .htaccess file in your webserver (or on the web hosting you use) to get this done.

This is the answer you are looking for:
http://www.blog.highub.com/apache/http- ... omain-url/

Hope that helps.


Return to “Hosting - Free Solutions”

Who is online

Users browsing this forum: No registered users and 0 guests

cron