I have a windows server hosting my site. I asked them the following question: I want to change my http://www.danscartoons.com/ in the .htaccess file to http://danscartoons.com/ via the Advance mod_rewrite function. Here is the answer from their tech support: This is not possible as mod_rewrite is only available on our unix servers and your site is on a windows server. You can search for "php redirect" or "asp redirect" on a search engine to find information on how to do this using php or asp. Anything I can do to work around this? Btw, my host's server already allows a PHP script that controls the rotation of a daily image on my site.
You can use also meta refresh or javascript redirection. <?php header('Location: site.com'); exit; ?> PHP: Cheers
Hi Koko: So I would make it look like this?: <?phpheader('Location: http://danscartoons.com/');exit;?> And put this code into my site on the server? (note forward slash after the dot com)
Hi dinrock Only do not miss interval after php-open tag, but yes, it can be placed on one line: <?php header('Location: http://danscartoons.com/');exit;?> PHP: Regards
I think what he's trying to do is make the non-www be his canonical address. The only thing I can think of is mod_rewrite. It only works on UNIX-based systems like you said. But in any case you want to switch servers: RewriteEngine on RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^http://www\.danscartoons.com/ RewriteRule (.*) http://http://www.danscartoons.com//$1 [R=301,L] Code (markup):