Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2004
    Posts
    675

    Redirect all pages script?

    Is it possible to redirect every page that a person types to the main page?

    Example
    www.mypage.com/find.htm --> www.mypage.com

    www.mypage.com/blabla.htm --> www.mypage.com

    www.mypage.com/test/bla/ddd.php --> www.mypage.com

    Anything that a person types redirect to main page.

    I use cpanel.




    p.s didn't know where to post this.

  2. #2
    Join Date
    Dec 2002
    Location
    chica go go
    Posts
    11,876
    Don't bump threads.

    something like this may work...


    Code:
    RewriteEngine On
    RewriteRule (.*) http://yourpage.com

  3. #3
    Join Date
    Oct 2004
    Location
    San Francisco, CA
    Posts
    2,455
    Or you simply could have your 404 redirect to your homepage, but mikey's way is probably quickest
    Tyler Cole
    Eeek, a Blog

  4. #4
    Join Date
    Dec 2003
    Location
    Fairfax, Virginia
    Posts
    6,834
    EDIT: Err, that'd probably just redirect users infinitely.
    Last edited by SniperDevil; 06-22-2005 at 04:25 PM.

  5. #5
    Join Date
    Jun 2002
    Location
    Texas
    Posts
    7,954
    Moved to programming. Looks like you have a few options.

  6. #6
    Join Date
    Nov 2004
    Posts
    675
    Originally posted by Tyler
    Or you simply could have your 404 redirect to your homepage, but mikey's way is probably quickest
    What choud I use in my 404? What code?

    Thank you

  7. #7
    Join Date
    Jun 2004
    Location
    Bay Area -USA
    Posts
    1,740
    Why would you do this? Just wondering.
    <<< Please see Forum Guidelines for signature setup. >>>

  8. #8
    Join Date
    Nov 2004
    Posts
    675
    <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">

    Is the code for 404, for people who also have my problem

  9. #9
    Join Date
    Nov 2004
    Posts
    675
    Originally posted by VolkNet
    Why would you do this? Just wondering.
    I used to have a community website with over 3.000 uniqe visitors a day. My old host stopped and deleten all my files

    Yet all my users still link to me, so I needed the code to link them to my main page that explains the situation

  10. #10
    Join Date
    Jun 2004
    Location
    Bay Area -USA
    Posts
    1,740
    aww that sucks!!!

    With that kind of traffic you should put some ads up and get a better host lol.
    <<< Please see Forum Guidelines for signature setup. >>>

  11. #11
    Join Date
    Nov 2004
    Posts
    675
    I did exactly that but my own mysql backup is abit old

  12. #12
    Join Date
    Feb 2003
    Posts
    717
    Try this, just put it in your main .htaccess file:
    Code:
    ErrorDocument 404 /index.html
    index.html would be your main page, or where ever you want to direct to. This only works, though, if there is no page there, as it redirects all 404 errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •