: Mod rewrite doesn't work when i added multiple domains i have redhat linux server and i was using /var/www/html to display my site. By using the following directive rewrite mod was working fine.
i have redhat linux server and i was using /var/www/html to display my site.
By using the following directive rewrite mod was working fine.
<IfModule mod_rewrite.c>
# Enable mod_rewrite engine
RewriteEngine on
# WITH mandatory 'www.'
#RewriteCond %{HTTP_HOST} ^$uri.$tld$ [NC]
#RewriteRule ^(.*)$ www.$domain [L,R=301]
# WITHOUT 'www.'
RewriteCond %{HTTP_HOST} ^www.$uri.$tld$ [NC]
RewriteRule ^(.*)$ $domain/ [L,R=301]
</IfModule>
After the addition of
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domainmaster.com ServerAlias domainmaster.com *.domainmaster.com
DocumentRoot /var/www/domainmaster
</VirtualHost>
<VirtualHost *:80>
ServerName domainother.com ServerAlias domainother.com *.domainother.com
DocumentRoot /var/www/domainother
</VirtualHost>
url rewrite doesn't work. Website files wasn't modified. .htaccess file redirects all traffic to index.php and index.php decides which page to display.
Any ideas?
More posts by @Cugini213
1 Comments
Sorted by latest first Latest Oldest Best
Where do you place the mod_rewrite directives that you have provided?
If you still have those directives in httpd.conf, then, perhaps, they fall outside of the VirtualHost directives, and have no effect on your vhost domains?
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.