PDA

View Full Version : Oscommerce, pointer domain, subdomain, and .htaccess files


ioasw
1-1-06, 02:24 PM
I run oscommerce on my site, and oscommerce has it's own .htaccess file which is this:

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

<IfModule mod_php4.c>
php_value session.use_trans_sid 0
php_value register_globals 1
</IfModule>

I have a pointer domain that is registerd with powweb, and when I go to that pointer domain I am redirected to my main oscommerce site.

I would like to have a pointer domain be redirected with the adress bar masked as the pointer domain to a a subdomain on my site.

Now do I have to change the oscommerce .htaccess file or can I just put a .htaccess file in the htdocs of my sub domain?

I have searched but I have not found anyting about this situation. Thanks to anyone who can help.

stevel
1-1-06, 06:12 PM
You need the standard .htaccess code for causing a pointer domain to go to the subfolder of htdocs containing your store. This would go in your htdocs folder. You can't use osCommerce successfully with the subdomain method that puts the folder outside the main htdocs - at least if you want to use SSL.

The code in the htdocs .htaccess would look something like this:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} seconddomain.com
RewriteCond %{REQUEST_URI} !catalog/
RewriteRule ^(.*)$ catalog/$1 [L]

where "seconddomain.com" is your pointer domain and "catalog" is the subfolder of htdocs where your store is located.

ioasw
1-2-06, 08:27 AM
Yes I need to have SSL on my oscommerce site, so what you're saying is that it is impossible to have a pointed subdomain folder with an oscommerce site. Is it possible with a serviced domain? Or would I just have to buy a seperate domain altogether?

I tired putting that code that you gave me above, into the .htaccess file in my oscommerce site, but I'm guessing that dosen't work, right?

Thanks again Steve

stevel
1-2-06, 09:47 AM
No, that's not what I'm saying.

There are two ways on PowWeb to do subdomains. The "old way" is to create a subfolder under your htdocs and to have code in .htaccess that rewrites the request to reference the subfolder. The new way is to create a folder at the top level of your ftp root, alongside htdocs, and create an htdocs under it. The old way works with SSL, the new way does not.

You have talked about both subdomains and pointer domains - these are different concepts. Pointer domains require use of .htaccess code to reroute requests to a subfolder, and as I wrote earlier, this code must be in a .htaccess in htdocs directly, not in a subfolder.

Do not confuse the two. You may have initially set things up as a subdomain, but now what you want is a subfolder with rewrite code for a second domain.

A disadvantage of a pointer and serviced domains is that they do not have individual SSL hostnames. All domains in a package share the SSL hostname of the primary domain. Whether this is a problem for you or not, I don't know.

ioasw
1-2-06, 12:53 PM
You did it again Steve! It works. One more small thing though, I added your above code into the .htaccess file and now my pointed domain goes to the subfolder in my htdocs, but there are several subfolders in that subfolder in my htdocs, and each one of the folders contain a page for my subdomain which I am using my pointer for. It works for the main page so now I get www.zentrumcompany.com for www.jeewhizz.biz/zentrumcompany, but everytime I type in www.zentrumcompany.com/about_us I get www.zentrumcompany.com/zentrumcompany/about_us automatically, instead of just www.zentrumcompany.com/about_us. it's not that big of a deal but it would be nice if I could just have it say the one subfolder instead of two. Oh man I hope you understand all that, I barley understand what I wrote. Thanks alot though Steve.

stevel
1-2-06, 04:11 PM
You seem to have some /contacts subfolder being added. What exactly do you have for a .htaccess now? Did you perhaps add something also to the store .htaccess earlier in an attempt to solve this?

Your URLs don't work right now so I can't tell what is going on.

extras
1-2-06, 07:35 PM
Most probably, it's another case of very common "missing trailing slash problem".
http://forum.powweb.com/showpost.php?p=353630&postcount=5