Welcome to WebmasterWorld Guest from 54.205.170.21

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess redirect help

   
2:44 pm on May 5, 2011 (gmt 0)

5+ Year Member



Hello all, I haven't done a lot with HTACCESS so I'm asking for help.

I have a site that has been at www.site.com for a while that I am replacing with Wordpress. To avoid potential hassles with moving WP later on, I moved the site to a www.com/oldsite and installed WP in the root directory.

The WP site isn't ready yet so for now I want visitors to get an info page with a link to the old site.

In the root dir I also added .htaccess and comingsoon.php

This is the only line in .htaccess:
DirectoryIndex comingsoon.php


comingsoon.php has some text and link to the site at www.site.com/oldsite.

That works fine.

However now if I try to go to www.site.com/index.php (which should be the Wordpress home page) it takes me to comingsoon.php

Basically what I'm wanting is this:
www.site.com -> www.site.com/comingsoon.php
www.site.com/anypage.php -> stays at that page (if the page exists)
www.site.com/pagedoesntexist.php -> goes to www.site.com/oldsite/error.php

Any help is appreciated!
6:37 am on May 7, 2011 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



However now if I try to go to www.site.com/index.php (which should be the Wordpress home page) it takes me to comingsoon.php

i would use a tool such as the Live HTTP Headers firefox plugin to see what your response status code chain is.

www.site.com/pagedoesntexist.php -> goes to www.site.com/oldsite/error.php

rather than a redirect that response should be a 404 Not Found or 410 Gone status code.
then you can configure the server to display a Custom Error Response [httpd.apache.org] such as your error.php for the 404/410 response.
8:00 pm on May 7, 2011 (gmt 0)

5+ Year Member



I ended up going at this the other direction.
1) NO .htaccess
2) In WP set page X as my home
3) In WP page Y is my real home
4) Found a plugin that says if you hit X redirect to my old site

That took care of it until I switched it over.
7:13 am on May 9, 2011 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



did you solve the "soft 404" problem?
2:47 pm on May 9, 2011 (gmt 0)

5+ Year Member



NO, I couldn't figure it out...just had to go the WP route.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month