Find the answer to your Linux question:
Results 1 to 2 of 2
I deleted a php database forum on my static html website and now I'm getting all sorts of 404 errors in webmaster tools. I tried to do a redirect to ...
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    1

    301 redirect errors

    I deleted a php database forum on my static html website and now I'm getting all sorts of 404 errors in webmaster tools.

    I tried to do a redirect to my home page for example this page

    mydomain.c​om/​for​um/​vie​wto​pic​.ph​p?f​=4&​t=7​3&s​tar​t=0

    now redirects to my home page but the url is

    mydomain.com/?f=4&t=73&start=0

    what should my code in htaccess be?

    What am I doing wrong?!

    Thanks

    Mark

  2. #2
    Linux User Manko10's Avatar
    Join Date
    Sep 2010
    Posts
    250
    If you want to discard the query string, this should suffice, but of course requires that you do not have other parameters of these names in use:
    Code:
    RewriteCond %{QUERY_STRING} ^(([ft]|start)=\d+)+$
    RewriteRule ^.*$ http://example.com/ [L,R=301]
    I haven't tested this regexp yet. If it doesn't work, have a look at the mod_rewrite documentation.

    By they way, you should use example.com, example.net or example.org as example domains. These are reserved for this purpose. Other domains might be owned by someone.
    Refining Linux Advent calendar: “24 Outstanding ZSH Gems

Posting Permissions

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