mod_rewrite question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Pheer
    So Fucking Banned
    • Dec 2002
    • 22083

    #1

    mod_rewrite question

    Is there anyway to direct the wildcards to my 404 so it sends the 404 header?

    for instance.. blah.domain.com or just domain.com hit 404

    so if say... google spider requests a wildcard, or just domain.com, or a page that doesnt exist, it gets the 404 page?
  • V_RocKs
    Damn Right I Kiss Ass!
    • Nov 2003
    • 32449

    #2
    You would rather allow Google to spyder and give you the traffic based on the domain... Unless it is only going to be getting duplicate content. If it isn't going to be getting duplicate content then you would allow it to come in...

    Comment

    • V_RocKs
      Damn Right I Kiss Ass!
      • Nov 2003
      • 32449

      #3
      If it was going to be duplicate content then you would want to help yourself out SE wise and do a 301 so the SE's will give you credit.

      Comment

      • Mr Pheer
        So Fucking Banned
        • Dec 2002
        • 22083

        #4
        i dont want to do anything except what I asked about... does anyone know how to do it?

        Comment

        • mikeyddddd
          Viva la vulva!
          • Mar 2003
          • 16557

          #5
          Would something like this work?

          ErrorDocument 404 http://domain.com/404.html

          RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
          Rewriterule (.*) http://www.domain.com/$1 [R=404]

          404 goes to your page without www

          Rewrite adds the www and returns 404. Also catches any referrals without www.


          Or this just goes to root:

          ErrorDocument 404 http://domain.com/

          RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
          Rewriterule (.*) http://www.domain.com/ [R=404]


          or 404 page:

          ErrorDocument 404 http://domain.com/

          RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
          Rewriterule (.*) http://www.domain.com/404.html [R=404]

          Comment

          • Mr Pheer
            So Fucking Banned
            • Dec 2002
            • 22083

            #6
            thanks mikey

            I'll give those a try

            Comment

            Working...