louism
August 15, 2010, 12:00am
1
Hi,
I moved my CS-Cart installation (2.0.11) from a dedicated server to a shared hosting. The transfer process went relatively fine, except for the httpd.ini which I am not sure how to convert. Can I simply take the directives in httpd.ini and insert them in .htaccess ? I tried but it didn’t work.
I guess that was the content of httpd.ini that made the /admin transfer to admin.php
Here’s the content of my httpd.ini file (which cannot work in shared hosting environment):
[ISAPI_Rewrite]
RewriteRule /catalog/(.)? /catalog/$1 [L]
RewriteRule /addons/(. ) /addons/$1 [L]
RewriteRule /lib/(.) /lib/$1 [L]
RewriteRule /js/(. ) /js/$1 [L]
RewriteRule /skins/(.) /skins/$1 [L]
RewriteRule /install/(. ) /install/$1 [L]
RewriteRule /payments/(.) /payments/$1 [L]
RewriteRule /images/(. ) /images/$1 [L]
RewriteRule /index.php(.) /index.php$1 [L]
RewriteRule /admin.php(. ) /admin.php$1 [L]
RewriteRule (.?)(?(. ))? /index.php?sef_rewrite=1&$3 [L]
Here’s the content of my .htaccess file:
DirectoryIndex index.html index.php
RewriteEngine on
Some hostings require RewriteBase to be uncommented
Example:
So “RewriteBase” should be:
RewriteBase /store/cart
RewriteBase /store
RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} ./catalog/.
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
So how do I make this work again?
Those are separate files with their own specific code.
Taking a guess, I am going to say that your root directory has changed therefore you need to edit this line:
RewriteBase [COLOR="Red"]/store[/COLOR]
louism
August 16, 2010, 12:00am
3
The site is working.
Except for the /store/admin/ which does not redirect to admin.php which, I guess, was controlled by one of the rules in httpd.ini (I can guess which one, but it’s not working as is in .htaccess).
Your httpd.ini file is incomplete. Try this:
```php
[ISAPI_Rewrite]
Some hostings require UriMatchPrefix and UriFormatPrefix to be uncommented
Example:
So UriMatchPrefix and UriFormatPrefix should be:
UriMatchPrefix /store
UriFormatPrefix /store
[COLOR="Red"]UriMatchPrefix /store
UriFormatPrefix /store[/COLOR]
RewriteRule /catalog/(.*)? /catalog/$1 [L]
RewriteRule /addons/(.*) /addons/$1 [L]
RewriteRule /lib/(.*) /lib/$1 [L]
RewriteRule /js/(.*) /js/$1 [L]
RewriteRule /skins/(.*) /skins/$1 [L]
RewriteRule /install/(.*) /install/$1 [L]
RewriteRule /payments/(.*) /payments/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /index\.php(.*) /index.php$1 [L]
RewriteRule /admin\.php(.*) /admin.php$1 [L]
RewriteRule (.*?)(\?(.*))? /index.php?sef_rewrite=1&$3 [L]
```
louism
August 16, 2010, 12:00am
5
Hey! I can’t use httpd.ini on my shared hosting.
ISAPI_Rewrite is for windows based servers so that must be what you moved from
louism
August 16, 2010, 12:00am
7
I moved from Ubuntu to another Linux shared hosting.
How do I convert what was in httpd.ini since I cannot use httpd.ini on my shared hosting?
You don’t convert it.
If you could post more details or even better, error logs, then we might be able to help.
louism
August 16, 2010, 12:00am
9
I noticed that /store/admin did not redirected anymore to admin.php.
I guess that’s the httpd.ini that took care of that.
I am just wondering how to make it work again on my new web hosting without httpd.ini…