PDA

View Full Version : redirect with htaccess



albsure
12-05-2003, 08:08 AM
I would like to delet one of my page but redirect the traffic to the new page. But my old page name has a space in it and I can't seem to get the redirect to work.

Is there a way to compensate for the space without actually having it?

Thanks for any help.

Chris
12-05-2003, 11:56 AM
You could just put some redirect code in the file itself and not worry about .htaccess.

albsure
12-05-2003, 12:28 PM
code it in javascript

Chris
12-05-2003, 05:19 PM
Or with PHP.

incka
12-06-2003, 05:09 AM
I'm interested... What .htaccess code would I use?

bugsy
12-06-2003, 06:57 PM
I've encountered this problem myself before. I created a php page as a place holder and did a 301 redirect to the homepage.

Chris
12-07-2003, 09:40 AM
Here are two ways to do it.

Redirect 301 /folder/script.php http://www.yournewsite.com/folder2/script2.php

Or...

RedirectMatch 301 ^(.*)$ http://www.yournewdomain.com$1

The second example will redirect all files from one domain to equivalent files on a new domain. So

domain1.com/page.php

becomes

domains2.com/page2.php