I have recently moved a file from one location in my website directory structure to another. Though all the linking has been properly maintained, I see I am getting 404 errors when I attempt to go the old path. I am sure I am having a syntax error but don't know exactly what the problem is.

To be specific.

I want site vistors to automatically be redirected from one location to another when they enter the old URL.

The old URL is: http://www.homeadditionplus.com/Ceiling%20Fan%20Wiring.htm

The new URL is: http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

my redirect code is in the .htaccess file is:

redirect http://www.homeadditionplus.com/Ceiling%20Fan%20Wiring.htm http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

If you have any ideas on what I am doing wrong please respond.

Thanks,

Mark

I have recently moved a file from one location in my website directory structure to another. Though all the linking has been properly maintained, I see I am getting 404 errors when I attempt to go the old path. I am sure I am having a syntax error but don't know exactly what the problem is.

To be specific.

I want site vistors to automatically be redirected from one location to another when they enter the old URL.

The old URL is: http://www.homeadditionplus.com/Ceiling%20Fan%20Wiring.htm

The new URL is: http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

my redirect code is in the .htaccess file is:

redirect http://www.homeadditionplus.com/Ceiling%20Fan%20Wiring.htm http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

If you have any ideas on what I am doing wrong please respond.

Note I use Frontpage 2003 with frontpage extensions running on an Apache Server.

Thanks,

Mark

Note I use Frontpage 2003 with frontpage extensions running on an Apache Server.

The first argument for the redirect should be a relative path and not a full URL

The first argument for the redirect should be a relative path and not a full URL

I have tried that too to no avail. I think there is something special with Frontpage2003 extensions that is causing the problem.

here is a easy way to get where you want to be with out using htaccess just stick that in the body of the old page and direct it to the new one, not in the head in the body

<script language='javascript'>
var1=8;
var2=var1;
if(var1==var2) document.location="http://yoursitehere";
</script>

here is a easy way to get where you want to be with out using htaccess just stick that in the body of the old page and direct it to the new one, not in the head in the body

<script language='javascript'>
var1=8;
var2=var1;
if(var1==var2) document.location="http://yoursitehere";
</script>

Thank you for your input, however I can not keep the old file. The reason for the need to do redirects is that I have too many files in the root directory and my host provider is indicating to me that I have to move some files.

This is taken from my file which works as designed:

Redirect 301 /firstfile.html http://www.mhanp.org/nextfile.html

//Explaination

'Redirect 301' is the command function
'/firstfile.html' is the old file relative url
'http://www.abcdef.org/nextfile.html' is the url to which
the visitor is being sent

The file holding this instruction is '.htaccess'
Notice the dot preceeding the fine name.


Andy

Thanks,

However I think I have been doing this with no success.

I use the following command in my .htaccess file:

Redirect /Ceiling%20Fan%20Wiring.htm http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

The below old URL is what I am trying to redirect people away from:
http://www.homeadditionplus.com/Ceiling%20Fan%20Wiring.htm

The new URL to take its place is:

http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.