Board index   FAQ   Search  
Register  Login
Board index php forum :: php and mysql Web Hosting Hosting - Free Solutions

Redirection to be done

Free hosts to play with mysql and php .

Moderators: macek, egami, gesf

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
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 Mr182 » Tue Sep 21, 2010 10:59 pm

Code: Select all
<?php

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

?>
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 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
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 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.
phpweby
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Sep 29, 2010 7:05 am


Return to Hosting - Free Solutions

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron