Results 1 to 8 of 8

Thread: .htaccess All Page Redirect

  1. #1
    Join Date
    Jul 2009
    Location
    ProxySites.ca
    Posts
    241

    .htaccess All Page Redirect

    I have a very simple .htaccess question

    I want to direct all traffic that travels to a non existing page to be forwarded to the homepage.

    So if I make a spelling mistake in typing in the sub directory it will take me to the home page.

    How can I do this?

  2. #2
    Hey there. there are many methods you can do to achieve this redirection and the easiest is the following:

    Open .htaccess with a text editor and add the following line
    of course, you need to edit the URL to your homepage
    Code:
    ErrorDocument 404 http://www.example.com
    hopefully this information was useful. if you ran into troubles let me know!

  3. #3
    Join Date
    Jul 2009
    Location
    ProxySites.ca
    Posts
    241
    perfect thanks man!

  4. #4
    Another way to do it would be:

    RewriteRule ^wd/wws/index.html(.*) URLto301to [R=permanent,L]

    In this case there were links to http://www.md5.net/wd/wws/index.html. I redirected just that without essentially breaking all 404s.
    Last edited by nux; 18 February, 2010 at 21:38 PM.
    Submit Your Proxies @ NewProxySites.com

  5. #5
    There's another way that Wordpress uses to redirect any non-existing pages to the script for implementing SE friendly URLs. But I don't know the exact code to solve the above problem.

    Aziz's 404 redirect seems like the simplest method to me, and it is taking care of the fact that the incorrect URL was initially entered by mistake. Maybe with 301 it could be regarded as a correct URL?

  6. #6
    This is another way to do it:

    RewriteRule ^.*$ index.php [QSA]

    --
    Web: soft-industry.com
    E-Mail: support@soft-industry.com
    Skype Isupport.soft-industry.com

  7. #7
    Quote Originally Posted by Aziz View Post
    Hey there. there are many methods you can do to achieve this redirection and the easiest is the following:

    Open .htaccess with a text editor and add the following line
    of course, you need to edit the URL to your homepage
    Code:
    ErrorDocument 404 http://www.example.com
    hopefully this information was useful. if you ran into troubles let me know!
    thanks, helped me also

  8. #8
    @ProxySites.ca

    Redirecting all 404 links to the home page will give you negative points in SERP.

Similar Threads

  1. .htaccess / redirect to 'www.'
    By Snak3 in forum On-Site SEO
    Replies: 12
    Last Post: 30 December, 2009, 20:13 PM
  2. .htaccess
    By dodolls in forum Managing
    Replies: 6
    Last Post: 15 November, 2009, 07:58 AM
  3. Replies: 1
    Last Post: 18 October, 2009, 03:31 AM
  4. .htaccess help needed - dynanmic redirect
    By DomainMagnate in forum Programming
    Replies: 13
    Last Post: 27 September, 2009, 11:52 AM
  5. .htaccess - How to properly redirect a domain?
    By Shenron in forum Programming
    Replies: 10
    Last Post: 9 January, 2009, 09:30 AM

Tags for this Thread

Bookmarks

Posting Permissions

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