| | |
How to perform redirects using htaccess file
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2006
Posts: 5
Reputation:
Solved Threads: 0
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/Ceil...n%20Wiring.htm
The new URL is: http://www.homeadditionplus.com/Elec...n%20Wiring.htm
my redirect code is in the .htaccess file is:
redirect http://www.homeadditionplus.com/Ceil...n%20Wiring.htm http://www.homeadditionplus.com/Elec...n%20Wiring.htm
If you have any ideas on what I am doing wrong please respond.
Thanks,
Mark
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/Ceil...n%20Wiring.htm
The new URL is: http://www.homeadditionplus.com/Elec...n%20Wiring.htm
my redirect code is in the .htaccess file is:
redirect http://www.homeadditionplus.com/Ceil...n%20Wiring.htm http://www.homeadditionplus.com/Elec...n%20Wiring.htm
If you have any ideas on what I am doing wrong please respond.
Thanks,
Mark
•
•
Join Date: Jul 2006
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Mark Donovan
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/Ceil...n%20Wiring.htm
The new URL is: http://www.homeadditionplus.com/Elec...n%20Wiring.htm
my redirect code is in the .htaccess file is:
redirect http://www.homeadditionplus.com/Ceil...n%20Wiring.htm http://www.homeadditionplus.com/Elec...n%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
The first argument for the redirect should be a relative path and not a full URL
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
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
[html]<script language='javascript'>
var1=8;
var2=var1;
if(var1==var2) document.location="http://yoursitehere";
</script>[/html]
[html]<script language='javascript'>
var1=8;
var2=var1;
if(var1==var2) document.location="http://yoursitehere";
</script>[/html]
Last edited by tgreer; Jul 20th, 2006 at 7:58 pm. Reason: User ignored directions for using CODE tags.
Scripts Installed, SEO Work Done,
Need Traffic We Can Help!
Contact Me Today! On Line Since 95
Icq:346230916
webmistress@officialwls.com
Domains & Sites
For Sale!
Some Hot Forum Names!
Need Traffic We Can Help!
Contact Me Today! On Line Since 95
Icq:346230916
webmistress@officialwls.com
Domains & Sites
For Sale!
Some Hot Forum Names!
•
•
Join Date: Jul 2006
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by MamawDenise
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>
•
•
Join Date: Feb 2005
Posts: 9
Reputation:
Solved Threads: 1
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
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
•
•
Join Date: Jul 2006
Posts: 5
Reputation:
Solved Threads: 0
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/Ceil...n%20Wiring.htm
The new URL to take its place is:
http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm
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/Ceil...n%20Wiring.htm
The new URL to take its place is:
http://www.homeadditionplus.com/Electrical%20Articles/Ceiling%20Fan%20Wiring.htm
![]() |
Similar Threads
- custom .htaccess file 301 Redirect to non www form (Search Engine Optimization)
- .htaccess File Problems (*nix Software)
- custom .htaccess file 301 Redirect to non www form Prolems (Search Engine Optimization)
Other Threads in the HTML and CSS Forum
- Previous Thread: Content container's shadow displaying differently ???
- Next Thread: IFRAME and window positioning
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






