.htaccess - ErrorDocument redirect to different page per virtual directory -


i've tried every way , couldn't find direct answer particular question. have .htaccess rewrite rules friendly urls , want handle 404 errors may occur in various ways.

first, here couple of rewrite rules:

rewriterule ^newsite/designer/([a-za-z0-9_.%&-]+).html/?$ newsite/catalog.php?m=$1 [nc,l,b,qsa] rewriterule ^newsite/search/([a-za-z0-9_.%'&-]+)/?$ newsite/catalog.php?kw=$1 [nc,l,b,qsa] 

i direct 404 errors search/ differently 404 error within designer/. each having own destination. since these not actual directories can't put separate .htaccess file in directoies.

ultimately want have other 404 not expressly redirected go catchall, like

errordocument 404 /index.php 

is possible , how?

you can use <location> sections in configuration:

<location /newsite/designer>     errordocument 404 wherever </location> 

however, there many cases in may not 404 (if request matches rewriterules , it's inside script can't find match), depending on how script works.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -