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

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -

python - Writing Greek in matplotlib labels, titles -