need to permanently redirect my webpage

Thats a nasty way that can potentially break the back button if misused. The best way is to use mod_rewrite

Make a file called .htaccess in the root of the first site and put this in it:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com$1 [R=301,L]
</IfModule>
 
Moredhel said:
Thats a nasty way that can potentially break the back button if misused. The best way is to use mod_rewrite

Make a file called .htaccess in the root of the first site and put this in it:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.newdomain.com$1 [R=301,L]
</IfModule>

ok i get the following error:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

the .htaccess file i have used is

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.theaccountancyforums\.com$ [NC] RewriteRule ^(.*)$ http://www.theaccountancyforums.com/forums$1 [R=301,L]</IfModule>

any ideas :(
 
That's some strangeness. Symbols all over the place (%, ^, \ before dots, $).

Edit: Oh beanie, could you sort out my uploader area please? It hasn't worked in ages.
 
joeyjojo said:
That's some strangeness. Symbols all over the place (%, ^, \ before dots, $).

Edit: Oh beanie, could you sort out my uploader area please? It hasn't worked in ages.
Assuming your username is the same as your OcUK one, I just fixed it. I deleted everything because it was full of rubbish and taking up disk space which I needed :)

(But I do have backups for people who need stuff they uploaded.)
 
Rubbish?! What! So much useful stuff I've made for people over the months :( Nah it's fine, as you say, no great loss unless people need things :)

So instead of giving people less space to begin with you just delete everything when it gets half full? :D
 
joeyjojo said:
Rubbish?! What! So much useful stuff I've made for people over the months :( Nah it's fine, as you say, no great loss unless people need things :)

So instead of giving people less space to begin with you just delete everything when it gets half full? :D
Aye :D

But seriously, I had no choice - especially since I was away and hence unable to monitor it :)
 
backtothefuture said:
ok i get the following error:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

the .htaccess file i have used is

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.theaccountancyforums\.com$ [NC] RewriteRule ^(.*)$ http://www.theaccountancyforums.com/forums$1 [R=301,L]</IfModule>

any ideas :(

your getting internal server errors as youve placed a .htaccess file into your website directionary

i use this http://php.about.com/od/learnphp/ht/phpredirection.htm
 
backtothefuture said:
ok i tried the above with

<?php
header( 'Location: http://www.theaccountancyforums.com/forums.html' ) ;
?>

and replaced the index.htm file with the new index.htm file containing only the above...

all I get now is a blank page :confused:

Don't mean to hijack but I'm in a similar situation with backtothefuture.

I've done what he's done and got a blank. I changed it to a .php and I got a 403 error?
 
works for me :p


it's just a blank page with the above code and called 'index.php' placed in the directory where the address points too.

edit:

1) that address doesn't work anyway
2) you got the quote marks wrong
 
Last edited:
" and ' both work in PHP, "" gets parsed for variables / escape codes etc while '' doesn't but as you're not using either in that header, it doesn't matter.
 
Back
Top Bottom