php - How i can edit my htaccess file to let my site work with "www" only -


मेरा .htaccess फ़ाइल कोड है

  डायरेक्टरी इंडेक्स रूटर.php विकल्प + अनुवर्ती लिंक रीवरइटइन्गइन रीव्रैइटकॉन्ड पर % {REQUEST_FILENAME}! -f पुनर्लेखनकंड% {REQUEST_FILENAME}! -d रिक्राइटकॉन्ड $ 1 ^ (। *) $ पुनर्लेखन नियम ^ (। *) $ Router.php? _doroute = $ 1 [एल, क्यूएसए]   

मैं अपनी साइट को "www" के साथ ही बताना चाहता हूं

मैं इसके साथ इस कोड को एकीकृत नहीं कर सका

  RewriteEngine RewriteCond% {HTTP_HOST} पर! ^ www \। RewriteRule ^ http: //www.% {HTTP_HOST}% {REQUEST_URI} [एल, आर = 301]   

क्या कोई मुझे मदद कर सकता है?

आपके .htaccess फ़ाइल का पूरा आउटपुट क्या है? आप RewriteRule ^ (। *) $ Router.php? _doroute = $ 1 का एक नियम दिखा रहे हैं [एल, क्यूएसए] जो उस नियम के अंत में प्रसंस्करण को रोकने का संकेत देता है, [एल]।

यदि आप बस जोड़ रहे हैं:

  पुनर्लेखन% {HTTP_HOST}! ^ Www \। RewriteRule ^ http: //www.% {HTTP_HOST}% {REQUEST_URI} [एल, आर = 301]   

तब आपकी समस्या होगी।

एक वैकल्पिक विधि है:

  पुनर्लेखन% {HTTP_HOST} ^ example.com $ RewriteRule (। *) Http: //www.example.com$1 [R = 301]    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -