![]() |
.htaccess and redirect - not making sense
Hi
I have these two virtualhost entries in httpd.conf; here is the first: Code:
NameVirtualHost *:80 Code:
<VirtualHost *:80> Code:
<IfModule mod_rewrite.c> apache is restarted after each change, though changes in .htaccess do not seem to need a restart. Any help would be good - have been working on this for a few nights now. Compfused |
Are you using apache2 for web development environment?
I mean, you are not using XAMPP. correct? 1) Can you check following line in your /etc/apache2/apache2.conf Code:
AddHandler application/x-httpd-php .htm 2) Check following line in your apache conf file Code:
AccessFileName .htaccess Code:
<Directory /your/drupal/project/path> |
thanks ++ PK - the AddHandler directive worked a treat!
So simple! Compfused |
An update on this...its an apache2 linux server, and the expected rewrite is not happening after I moved another drupal based virtualhost, call it drupal2, to the new location of /var/www/html:
ie we have hol-server.com.au with DirectoryRoot of /home/main_directory/drupal and drup2-server.com.au with DirectoryRoot of /var/www/html/drupal2, but originally /home/main_directory/drupal2 For rewriting purposes, even after the move to the completely different directory, I can't seem to free drup2-server.com.au from its dependency on the original /home/main_directory/drupal/.htaccess file. The moved site is otherwise working normally drup2-server.com.au 's httpd.conf entry is now: Code:
<VirtualHost *:80> Code:
AccessFileName .htaccess I also tried putting the rewrite directives into /var/www/html/drupal2/.htaccess, but that did not help either. Apache was restarted. Any idea on this one please? Thanks Compused Edit: have removed the [SOLVED] label due to this subsequent unexpected finding. |
Add following lines in your httpd.conf file
Code:
|
The problem is simple. You need to use serveralias if you want multiple names pointing to the same virtual host. So in the case of the first virtual host you need to add the www as the server alias:
Code:
servername hol-server.com.au Code:
Servername www.cpserver.org.au |
Thanks, both of you guys. I'm crying. Its working. Fantastic relief.
Think it was the serveralias that did the trick. Compfused |
All times are GMT -5. The time now is 09:36 AM. |