Zen Cart Logo
Forums / General Questions / How do I use htaccess to not rewrite a subdomain?

How do I use htaccess to not rewrite a subdomain?

Views: 2,699

Results 1 to 4 of 4
16 Jan 2012, 6:53 PM
#1
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

How do I use htaccess to not rewrite a subdomain?

I have Zen-Cart installed in the public_html directory. I am upgrading it in the public_html/zen directory, I have it set up as a subdomain, so it should be zen.mysite.com.au. However, the htaccess file for the main site is causing the subdomain to redirect to the main site.

I have tried all kinds of additions to the htaccess file, but I can't find anything to stop the subdomain from redirecting. If I go to mysite.com.au/zen, it works fine, but if I go to zen.mysite.com.au, it redirects to mysite.com.au.

This is the htaccess file in the public_html directory:

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 wordpress directory

RewriteCond %{REQUEST_URI} !^/blog.* [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]

Don't rewrite new directory

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

Don't rewrite zen directory

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

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

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

Can anyone tell me what I need to add to make the subdomain stop redirecting? Please note that this is for a .com.au URL.

Thanks!

16 Jan 2012, 6:58 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How do I use htaccess to not rewrite a subdomain?

What's the need for any of these rewrites in the first place?
I might be missing something, but it all looks like needless overkill.

16 Jan 2012, 8:05 PM
#3
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: How do I use htaccess to not rewrite a subdomain?

The site is using the Ceon URI mod.

15 Feb 2012, 4:04 AM
#4
shades12345 avatar

shades12345

New Zenner

Join Date:
Feb 2011
Posts:
6
Plugin Contributions:
0

Re: How do I use htaccess to not rewrite a subdomain?

first go in
admin>module>Ceon URI -Installation Check-Click here to go to the Ceon URI Mapping Installation Check page.>Click this link to Select All of the above text (& automatically Copy it to the Clipboard in IE) paste in your .htaccess

search for your folder

Don't rewrite subdomain or add-domain directory

RewriteCond %{REQUEST_URI} !^/subdomain or add-domain/ [NC]

replace %{REQUEST_URI} with %{THE_REQUEST}
and save