Jump to content

Trying To Use .htaccess Redirect On A 404 Error Pg


kaseytraeger

Recommended Posts

I'm trying to use .htaccess to redirect users to a custom error page inside my MT installation (so I can use my blog templates). I've set it up in .htaccess as

>Redirect /home/cpanelname/public_html/doggydiaries/404.shtml http://www.pudgypuppy.com/doggydiaries/404.php

where doggydiaries is set up as a subdomain.

 

I then installed a custom error page at http://www.pudgypuppy.com/doggydiaries/404.php.

 

When I tested it out, however, by using the page http://www.doggydiaries.pudgypuppy.com/hello.php, I was not redirected. Instead, I received the standard, non-friendly error message as shown in the attached image.

 

Any idea how to fix this so I can successfully redirect users to an error page that makes us of my MovableType templates?

 

Thanks.

post-33-1089740245_thumb.jpg

Link to comment
Share on other sites

Rob,

 

If I code my .htaccess file that way, will that redirect error pages only for the subdomain "doggydiaries.pudgypuppy.com"? I don't have a custom error page set up under the TLD yet, so I'm not sure how it would redirect if someone were to try to reach the page doggydiaries.pudgypuppy.com/nosuchpageexists.htm versus trying to reach the page pudgypuppy.com/nosuchpageexists.htm.

Link to comment
Share on other sites

You can disregard my previous post. I got it all figured out. I put a new .htaccess file in my subdomain directory. The only line in that file is

>ErrorDocument 404 http://www.doggydiaries.pudgypuppy.com/404.php

 

The .htaccess in the TLD (pudgypuppy.com) has not been altered. Once I create a custom error page for pudgypuppy.com, I should be able to access it using this line in the .htaccess file for pudgypuppy.com:

>ErrorDocument 404 http://www.pudgypuppy.com/404.php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...