mod_rewrite working but not?
Posted: Tue Jan 18, 2011 4:44 am
I am trying to move a website to a new host. The old host was running some flavor of Linux but now it will be put on a Windows server.
The problem I am having is with the mod_rewrite module. Although it is being loaded just fine, I can't seam to get anything to work. In the simplest situation, I have a directory structure like this:
[text]htdocs/
uudised/
index.php
index.php
.htaccess[/text]
Now I don't want to delete the uudised/ directory but I don't want it to be accessable either. I want everything to be moved to the htdocs/index.php file using mod_rewrite.
So, in the htdocs/.htaccess file I have this:
As for the virtual host, this is the record:
The problem I am having is with the mod_rewrite module. Although it is being loaded just fine, I can't seam to get anything to work. In the simplest situation, I have a directory structure like this:
[text]htdocs/
uudised/
index.php
index.php
.htaccess[/text]
Now I don't want to delete the uudised/ directory but I don't want it to be accessable either. I want everything to be moved to the htdocs/index.php file using mod_rewrite.
So, in the htdocs/.htaccess file I have this:
Which is exactly how it was on the previous server. This gives no errors but still isn't working. I know the file is at least being loaded because if I write a line of garbage, apache throws me the internal server error so at least the file is being read.RewriteEngine on
RewriteCond %{ENV:REDIRECT_SCRIPT_URL} ^$
RewriteRule ^/uudised(.*)$ /index.php?page=uudised [L,PT]
As for the virtual host, this is the record:
Now my skills in apache and mod_rewrite are not so awesome so if I am missing something obvious here, please let me know. I can't think of anything and as far as I can tell, on server that is nearly 100% identical, there is no problem with mod_rewrite. Can someone shed some light on the situation?<Virtualhost ###.###.##.###>
DocumentRoot "C:\www\www.example.ee\www.example.ee"
ServerName sub.example.com
Customlog C:\www\logs\sub.access.log combined
Errorlog C:\www\logs\sub.error.log
</VirtualHost>