Mobile app version of vmapp.org
Login or Join
Cugini213

: 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.

@Cugini213

Posted in: #Apache #ModRewrite #Virtualhost

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cugini213

1 Comments

Sorted by latest first Latest Oldest Best

 

@Murray432

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?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme