homepage Welcome to WebmasterWorld Guest from 54.205.168.88
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess redirect help
IntegrityWebDev




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

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!

 

phranque




msg:4309186
 6:37 am on May 7, 2011 (gmt 0)

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.

IntegrityWebDev




msg:4309373
 8:00 pm on May 7, 2011 (gmt 0)

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.

phranque




msg:4309724
 7:13 am on May 9, 2011 (gmt 0)

did you solve the "soft 404" problem?

IntegrityWebDev




msg:4309861
 2:47 pm on May 9, 2011 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved