Zen Cart Logo
Forums / Installing on a Linux/Unix Server / .htaccess settings for URI Mapping on new custom dedicated server?

.htaccess settings for URI Mapping on new custom dedicated server?

Views: 1,524

Results 1 to 5 of 5
9 Jun 2011, 12:42 PM
#1
fawad123 avatar

fawad123

New Zenner

Join Date:
Oct 2009
Posts:
93
Plugin Contributions:
0

.htaccess settings for URI Mapping on new custom dedicated server?

I'm currently using Dedicated server to test my zen cart website.
The temporary url i have been assigned is http://serverip/~username/.

I can access my website but if i click on any category i get server error. The following .htaccess file is for http://www.mydomain.com but here in this case a new folder ~username is compulsory to access the pages.

RewriteEngine On

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

Please tell me what should be added to access the pages on dedicated server?

9 Jun 2011, 12:55 PM
#2
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: .htaccess settings for URI Mapping on new custom dedicated server?

I don't know if it will work anyway with an ip address as opposed to using a domain name, but you are missing an important line when using server-based pathways. Because the root is the server and not the domain name you need to have this as your starting point:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /~username/

Vger

9 Jun 2011, 1:39 PM
#3
fawad123 avatar

fawad123

New Zenner

Join Date:
Oct 2009
Posts:
93
Plugin Contributions:
0

Re: .htaccess settings for URI Mapping on new custom dedicated server?

I have updated that but still getting the following error:

404 Not Found
The server can not find the requested page:

9 Jun 2011, 2:21 PM
#4
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: .htaccess settings for URI Mapping on new custom dedicated server?

Well, has your dedicated server got the mod_rewrite.so module enabled in php.ini?

Vger

9 Jun 2011, 7:27 PM
#5
fawad123 avatar

fawad123

New Zenner

Join Date:
Oct 2009
Posts:
93
Plugin Contributions:
0

Re: .htaccess settings for URI Mapping on new custom dedicated server?

Yes they are updated but I have come to know that this URI mapping will not work in such a way.

Thanks for your help.