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

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -