Help on URL rewrite

Discussion in 'Apache' started by kks_krishna, Jul 28, 2007.

  1. #1
    kks_krishna, Jul 28, 2007 IP
  2. digitalboy

    digitalboy Guest

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use 404 rewrite:

    redirect 404 h t t p : //www.site.com
     
    digitalboy, Jul 28, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    digitalboy, that won't work. And he only wants removed pages to redirect to home pages, not to set the error document for 404 errors. (Which would be done with ErrorDocument, not Redirect.

    krishna, just use a "Gone" status and Google will take the page out of the index next time it crawls your site:
    Redirect 410 /2007/01/criteria-query-examples-in-last-lesson.html
    ErrorDocument 410 /
    Code (markup):
    The ErrorDocument is used to redirect users to the home page.
     
    krt, Jul 28, 2007 IP
  4. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #4
    What is "Gone" status.
    How to use that.



     
    kks_krishna, Jul 28, 2007 IP
  5. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #5
    I have 730 pages Not Found error. all the pages under /2007/01/. how can i set the rule for bulk.
     
    kks_krishna, Jul 28, 2007 IP
  6. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #6
    one more doubt:

    i am setting like this :
    Redirect 410 /sitedir/news/cheap%20xenical
    Redirect 410 /sitedir/news/goodwork%20abi
    Redirect 410 /sitedir/news/goodwork%20adv

    Here %20 is space in the url. how can i set it in the Rule.
    Please help me.
     
    kks_krishna, Jul 28, 2007 IP
  7. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #7
    This will apply to any file inside the /2007/01/ directory
    RedirectMatch 410 /2007/01/.+
    Code (markup):
    "Gone" status means a page no longer exists, and is done by sending a 410 status code as in the code above.

    Just use a space, but wrap the URL in quotes, e.g.:
    Redirect 410 "/sitedir/news/cheap xenical"
    Redirect 410 "/sitedir/news/goodwork abi"
    Redirect 410 "/sitedir/news/goodwork adv"
     
    krt, Jul 28, 2007 IP