Web Hosting Talk







View Full Version : How do you create a redirection using httaccess


Haisoft
09-30-2001, 03:30 PM
Is it possible to use a .httaccess file for a redirection,
I want to redirect www.domain.com/domain to home/sites without touching the hppd.config file, what is the command, is it something like :
Redirect to home/sites ?

Richard

CmptrWz
09-30-2001, 04:16 PM
You COULD make an alias......

Haisoft
09-30-2001, 05:30 PM
Could someone please give me step by step instructons how to change the httpd.config file (is it the one in etc/httpd/conf/httpd.conf ? , there where 2 others when I did a whereis ).
Can you edit the file directley with telnet or do you have to download it using ftp. I've downloaded it changed it, what do I do next (a wget or something? , Do I have to delete the old one first, how do you rename a file using telnet (easier to rename and put back afterwards if something goes wrong). Once it is done, do I have to restart the server???

Richard

slade
09-30-2001, 05:56 PM
You can do what you asked for originally with .htaccess...
RewriteEngine On
RewriteBase /
RewriteRule ^olddir/oldfile.html$ newdir/newfile.html [R=301]


But I am not sure of the effect of this if you're wanting to move alot of files in alot of olddir's...
Perhaps someone wiser can grace us with a better answer?