मैं vhost config में mod_rewrite नियम जोड़ने की कोशिश कर रहा हूं लेकिन यह काम नहीं कर रहा है। साइट "mysite.com" साइट के लिए मैं होम पेज पर "/ webmedia /" को रीडायरेक्ट करना चाहता हूं।vhosts विन्यास में mod_rewrite
<VirtualHost 192.168.100.142:80>
ServerAdmin [email protected]
DocumentRoot /home/drupal_1
ServerName mysite.com
ServerAlias www.mysite.com
Alias /movies /home/movies/
ErrorLog /var/log/httpd/mysite.com_err_log
CustomLog /var/log/httpd/mysite.com_log special
<Directory /home/drupal_1>
Options FollowSymLinks Includes ExecCGI
AllowOverride All
DirectoryIndex index.html index.htm index.php
# Rewrite Rules #####################
RewriteEngine On
RewriteRule ^/webmedia/(.*)/[R=301,L]
# end Rewrite Rules #################
</Directory>
<Directory /home/movies>
Options FollowSymLinks Includes ExecCGI
AllowOverride All
DirectoryIndex index.html index.htm index.php
</Directory>
</VirtualHost>
क्यों एक '.htaccess' फाइल करने के लिए अपने नियम नहीं चलती? यह प्रबंधित करना अधिक आसान होगा क्योंकि आपके द्वारा किए गए प्रत्येक संशोधन के बाद आपको अपाचे को पुनरारंभ करने की आवश्यकता नहीं होगी। –
.htaccess फ़ाइल बड़ी हो रही है और मैंने सुना है कि सर्वर को vhosts फ़ाइल से इसे पढ़ने के लिए यह अधिक कुशल है। क्या वो सही है? – EricP
हां, अपाचे शायद 'faster_ को अनुमति दें' बिना अनुमति दें क्योंकि इसे प्रत्येक अनुरोध पर आपकी .htaccess फ़ाइल को पढ़ने की आवश्यकता नहीं है। मुझे लगता है कि प्रदर्शन का लाभ यहां _very_ छोटा है। इसके लिए आपके पास 'htaccess' में वर्तमान में क्या है? –