apache - htaccess - wildcard for redirecting all humans.txt requests to single location -
i'd redirect requests humans.txt (regardless of uri request) location of humans.txt file (located in top of domain).
my logs aren't showing evidence of google.com/humans.txt, it's not that problem. it's simple exercise in reducing 404 errors, i'm unsure whether utilize filesmatch or rewritecond. don't alter things (or experiment) often. file little , 1 time accessed, cached locally, in legitimate cases, ought 301 redirect 304 'not modified' thereafter.
so if request www.pretendexample.com/about/humans.txt or www.pretendexample.com/news/humans.txt, both redirect www.pretendexample.com/humans.txt
i don't plan have more 1 humans.txt, , mod.rewrite available. prefer utilize htaccess other solutions.
thanks much!
you can following:
rewriteengine on rewriterule ^.+humans\.txt$ /humans.txt [nc,qsa,l,r=301]
put in origin of root .htaccess-file, , else (not ending on humans.txt
) executed before !
apache .htaccess mod-rewrite redirect
No comments:
Post a Comment