1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To Redirect 404's to the HomePage When my site is in a Subdirectory....?

Discussion in 'Apache' started by pcrcool, Apr 6, 2014.

  1. #1
    I had this code which worked fine when my site and its files were in the home root folder, but I changed to a new host that already had domains on it, so my site is now in a SUBDIRECTORY and the following code no longer works:

    RewriteCond %{HTTP_HOST} ^MyDomain.com$ [OR]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html
    RewriteRule ^(index\.html)?$ http://www.MyDomain.com/ [L,R=301]

    How do I modify it to make it work, do I need to include the subdirectory name in it? Right now if I typed in a non existing url "MyDomain.com/blahblah567 ....it just shows "page not found" type of thing.

    Thanks
     
    pcrcool, Apr 6, 2014 IP