regex - Remove everything after last folder htaccess -


मेरे पास निम्न htaccess कोड है:

  पुनर्लेखनकोंड% {REQUEST_FILENAME}! -f पुनर्लेखक % {REQUEST_FILENAME}! -d रिवेराइटियम ^ ([^ /।] +) / ([^ / \।] +) Index.php? कार्य = स्थान और राज्य = $ 1 और शहर = $ 2 [एल]   

यह यूआरएल की तरह है:

  website.com/texas/houston website.com/new-york/new-york ...   

अगर मैं यूआरएल के वेबसाइट www.texas/houston/bfdsjfds पर जाता हूं, तो मुझे यूआरएल के लिए वेबसाइट www.doxas/houston जैसे सामग्री मिलती है। ऊपर दिए गए उदाहरण में मैं "/ bfdsjfds" कैसे निकाल सकता हूं? या उस पृष्ठ को 404 पर रीडायरेक्ट करें।

आप एंड एंकर $ केवल / state / city :

  रीवाइट कंडोम% {REQUEST_FILENAME} से मेल खाएगा! -f पुनर्लेखन कन्वर्ट% {REQUEST_FILENAME}! -d रीव्रेट नियम ^ ([^ /।] + ) / ([^ /।] +) /? $ index.php? कार्य = स्थान और राज्य = $ 1 और शहर = $ 2 [एल]   

यह स्वचालित रूप से < कोड> वेबसाइट / टेक्सास / उज्ज्वल / बीएफडीजफ़ोड यूआरएल के प्रकार।

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -