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

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

c# - Roxy file manager in MVC doesn't accept session path -

java - Ajax call to jsp and jsp redirecting to further jsp -