regex - Redirect all request to subfolders .htaccess -


यह मेरे वर्तमान में है

  RewriteEngine On RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -d रिवेराइट्यूल (। *) Index.html [एल]   

तो गैर-मौजूद फ़ाइलों के सभी अनुरोध index.html फ़ाइल पर समाप्त हो जाते हैं। लेकिन मैं केवल यह चाहता हूं कि शीर्ष स्तर के अनुरोधों के लिए हो, उदा। "" या ""।

जैसे अनुरोधों और आदि। मैं एक 404 त्रुटि फेंकना चाहता हूं।

संपादित करें: अनुरोधित पथ "/ एबीसी / डीईफ़" कुछ भी हो सकता है

इसके लिए आपको अपने यूआरआई मेलिंग regex को थोड़ी जरूरत है:

  RewriteEngine On RewriteCond% {REQUEST_FILENAME}! -f पुनर्लेखनकंड% {REQUEST_FILENAME}! -डी रिवेराइटियम ^ [^ /] + /? $ Index.html [एल]    

Comments

Popular posts from this blog

Selenium IDE Conditional Statements -

php - Something wrong with this for loop -

ruby on rails - How to avoid ActionController::InvalidCrossOriginRequest exception? -