2012-04-05 18 views
12

मैं पुनर्लेखन नियम छोड़ने की सुविधा फ़ाइल या निर्देशिका मौजूद है मेरी htacess फ़ाइल समायोजित करने के लिए कोशिश कर रहा हूँ मौजूद है, लेकिन जब फ़ाइल मौजूद है, यह कुछ अलग करने के लिए यूआरएल बदल जाता है। मुझे नहीं पता कि यह क्यों हो रहा है।RewriteCond शासन छोड़ने की सुविधा फ़ाइल या निर्देशिका

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f [OR] 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^project/([^/\.]+)/?$ index.php?view=project&project=$1 [L] 
RewriteRule ^for/content/ag index.php?view=opening&section=ag [L] 
RewriteRule ^for/content/bus index.php?view=opening&section=bus [L] 
RewriteRule ^for/content/fcs index.php?view=opening&section=fcs [L] 
RewriteRule ^for/content/market index.php?view=opening&section=market [L] 
RewriteRule ^for/content/trade index.php?view=opening&section=trade [L] 
RewriteRule ^for/content/teched index.php?view=opening&section=teched [L] 
RewriteRule ^for/content/([^/\.]+)/?$ index.php?view=content_area&section=$1 [L] 

निर्देशिका/परियोजना/एनटीआई मौजूद है, एक index.php फ़ाइल के साथ: यहाँ अपने htaccess फ़ाइल है। जब पता mywebsite.com/folder/project/nti दर्ज किया गया है, यह & परियोजना = एनटीआई mywebsite.com/folder/project/nti/?view=project में बदल जाएं। मैं इसे एक परीक्षण सर्वर पर लागू कर रहा हूं जहां नमूना साइट सबफ़ोल्डर में है, लेकिन जब कार्यान्वित की जाती है, तो यह मूल वेब सर्वर फ़ोल्डर में होगी।

किसी भी मदद के लिए धन्यवाद!

उत्तर

25

निकालें अतिरिक्त [OR] और अपने इस तरह कोड:

# If the request is not for a valid directory 
RewriteCond %{REQUEST_FILENAME} !-d 
# If the request is not for a valid file 
RewriteCond %{REQUEST_FILENAME} !-f 
# If the request is not for a valid link 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^project/([^/.]+)/?$ index.php?view=project&project=$1 [L,NC,QSA]