Page 1 of 1

Redirect subfolder to a catagory

Posted: Wed Dec 31, 2008 8:23 pm
by mpking
So I used to have a different website in a subfolder off my root. The software that it was using go hacked. (SQL injection)

So i've deleted the entire folder (and it's accompany database, and I'm changing all my passwords now).

What I'd like to do is redirect the folder to a specific catagory in my root folder..

EG http://www.mpking.com/cca
redirect to:
http://www.mpking.com/categories/13-CCA

I made a index.php with the following and placed it in the cca folder:

Code: Select all

<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mpking.com/categories/13-CCA");
exit();
?>
But i just get redirected to the root folder.

I have URL Rewriting set to use Apache errorhandling. (it was defaulted to none)

What am I missing?

Re: Redirect subfolder to a catagory

Posted: Thu Jan 01, 2009 1:00 pm
by garvinhicking
Hi!

It seems that because you use only "/cca/" some other default URL gets called. If you explicitly call http://www.mpking.com/cca/index.php it works. Check your .htaccess of the /cca/ directory to see if it specifies another IndeFilex than index.php.

Regards,
Garvin

Posted: Thu Jan 01, 2009 4:54 pm
by mpking
I just made a .htaccess file with the following contents in the /cca directory

Code: Select all

ErrorDocument 404 /index.php
DirectoryIndex /index.php
had no affect

Then I realized that code expressly calls the root, so I tried


Code: Select all

ErrorDocument 404 index.php
DirectoryIndex index.php

Still appears to have no effect.

My webhost is godaddy if that helps (linux hosting)

Posted: Thu Jan 01, 2009 6:04 pm
by garvinhicking
Hi!

Try Directoryindex /cca/index.php

Regards,
Garvin

Posted: Thu Jan 01, 2009 6:59 pm
by mpking
garvinhicking wrote:Hi!

Try Directoryindex /cca/index.php

Regards,
Garvin
Thanks, that was it!