Forum Moderators: phranque
I have just got my first own server. Well, not a dedicated one, but a VPS Root :) But its still cool.
I am new to all this server stuff so i ordered a PLESK control panel with it but it seems still not help me.
I have a website on it where i have the following in my .htaccess:
RewriteCond %{HTTP_HOST} ^www.mydomain\.com
RewriteRule ^index.php$ [mydomain.com...] [L]
On my old shared hosting it redirected all www.mydomain.com requests to the cgi script and all did worked fine.
Now i am getting an "Access forbidden!" error because there is no index.html file and it does not redirect anymore.
Now i am unsure if there is some setting on the server i need or is there a trick in the .htaccess to do. All other redirects to subpages work fine and also if i type www.mydomain.com/index.php it works.
Thanks for your help!
1) the mod_rewrite module must be loaded in the server config (this is true for (*any* rule, .htaccess or not)
2) The 'FileInfo' option for the AllowOverride config option must be in force for the directory your .htaccess file is in
3) The first rewrite line in the .htaccess file SHOULD be 'RewriteEngine on'
You'll need to check your httpd.conf for the first two; note that if you *do* have write access to httpd.conf, that is far and away the preferred place to have your Rewrite lines; the performance hit for using them in .htaccess is significant.
Meanwhile, i have found out a simple solution so simple that i didn't thought about it:
RewriteRule ^$ [hitscreen.com...] [L]
Anyway, thanks for the suggestions and your time ;)
RewriteEngine on
RewriteRule ^($¦index.php$) http://www.mydomain.com/cgi-bin/x.cgi [R,L]