Hello!
I’ve just bought a domain and a hosting package so I thought I can now deploy the website I’ve been working on on the server, but I ran into some trouble…so let me tell you something about it:
At its core, it’s just a simple website, so I started deveeloping it on my pc having the following configuration: Apache 2.2, MySQL 5+ and PHP 5+ on a Win7 OS. When I thought it was finished, I asked a frien to check it out on his pc which had Ubuntu installed and he told me he couldn’t even open the first page because of an internal server error. He also said that error came from my .htaccess file(keep this in mind because it’s important) so he changed it so it will work on his machine.
I never had linux installed on my pc before, but because of what he had told me I decided to install ubuntu too so he helped me and now I have kubuntu with gnome installed. I tried then to check my webite under the linux environment and it was like he said, it wouldn’t work until I changed the .htaccess file.
so this is how my htaccess file looked for a windows environment:
DirectoryIndex index.php
<IfModule mod_rewrite.c>
#Options +FollowSymLinks # < This throws error on my webhost's server
RewriteEngine on
# Make the following directories/files accessible
#
RewriteCond $1 !^(index\\.php|ajax\\.php|tmpl/*|style/*)
RewriteRule ^(.*)$ index.php?route=$1 [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
and this is how it had to look for a linux environment:
DirectoryIndex index.php
<IfModule mod_rewrite.c>
#Options +FollowSymLinks # < This throws error on my webhost's server
RewriteEngine on
# Make the following directories/files accessible
RewriteCond %{REQUEST_URI} !^/install/(tmpl/|style/|ajax)(.*)$
RewriteRule ^(.*)$ index.php?route=$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
ok, so I thought that should be all, so I went on and bought the domain( on a Linux CentOS server) and tried last night to set up my website. But here is the funny thing: it didn’t work using the linux environment I set up for it…what worked though, it was the settings for a windows environment… so I am very confused right now…
My questions are:
- why .htaccess directives are differently interpretted by apache server on a linux environment than a windows env?
- why my .htaccess file I set up for my local linux env is not working on a server(my webhost) running a linux environment? Is there a difference between CentOS and kubuntu+gnome?
- is there something I need to change on my local linux configuration?
Thank you in advance for any solutions or pointers
C.