Jump to content



Photo
- - - - -

Problem in redirect to subdomain

redirect subdomain configure files

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1   oscuser1960

oscuser1960
  • Members
  • 3 posts

Posted 22 August 2012 - 15:34

I am new to osCommerce I installed everything in (www.mydomain.com) and it’s working just fine now I am trying to redirect the oscommerce to a subdomain (store.mydomain.com) the redirecting worked but when I navigate to another page in my shop it bounce back to the original domain (mydomain.com).

I updated the: include/configure.php and admin/include/configure.php by changing the
HTTP_SERVER, ‘http://www.mydomain.com’ to HTTP_SERVER, ‘http://www.store.mydomain.com’
HTTP_CATALOG_SERVER, ‘http://www.mydomain.com’ to
HTTP_CATALOG_SERVER, ‘http://www.store.mydomain.com’

but the site was missing all the images and all the links are messed up. When I click any image or login for example I get error 404 page not found
Can anyone please tell me what should I do or what should I change in the configure.php files inorder or the redirect to work

Thank you for any help

New OsCommerce User

#2   MrPhil

MrPhil
  • Members
  • 5,241 posts

Posted 22 August 2012 - 15:43

Are you using some sort of SEO add-on? It may have some domain data stored in the database (consult the add-on's documentation).

You do not need "www.store...", just "store..." for the subdomain name. I presume that you've updated all domain name occurences in both configure.php files. Don't forget the filesystem (FS_) paths to your subdomain are probably different from the original domain.

How are you redirecting your site? Maybe there's a problem there. Again, any SEO involved? SEO usually means changes to the .htaccess file, and there could be a conflict between your redirection and SEO's own redirection.

#3   oscuser1960

oscuser1960
  • Members
  • 3 posts

Posted 22 August 2012 - 17:02

I created a subdomain in my host and then redirected it to the folder (mydomain.com/oscommerce/catalog).

I don’t have any SEO add-on

I didn’t change anything in the .htaccess file. As I told you I am new to all this

#4   MrPhil

MrPhil
  • Members
  • 5,241 posts

Posted 23 August 2012 - 00:37

Did you update the FileSystem paths in the configure.php files? If you have installed into a subdomain, the path to your files will have changed.

A subdomain "mysub.mydomain.com" is typically in "mydomain.com/mysub/" (...public_html/mysub/). Are you saying that you installed osC in the main domain, created a subdomain, and then redirected the entry point for the subdomain over to your osC installation in the main domain? If that's what you did, I would leave the configure.php entries alone (keep them mydomain.com/oscommerce/catalog and the original FileSystem paths). Just redirect the subdomain to the store, so that a visitor finds themselves in mydomain.com rather than mysub.mydomain.com.

Some hosting control panels have a lot of trouble redirecting between subdomains and main domains. You may well have to manually code the .htaccess file to do the redirection correctly.

What exactly are you trying to accomplish here with the subdomain and redirection?

#5   oscuser1960

oscuser1960
  • Members
  • 3 posts

Posted 23 August 2012 - 14:55

I was experimenting with oscommerce in my main domain the installation worked the database is working everything is ok. My boss decided that the name www.mydomain.com doesn’t indicate a store so he decided to go with store.mydomain.com and I did exactly what you said in last post

“Are you saying that you installed osC in the main domain, created a subdomain, and then redirected the entry point for the subdomain over to your osC installation in the main domain? If that's what you did,”

that is exactly what I did and it is working just fine but when I navigate to another page let’s say login it will take me back to the main domain. The url will say www.mydomain.com/oscommerce/......
What I need to accomplish is when I navigate to another page the url will say
www.store.mydomain.com/........
Do you think that is doable???

#6   MrPhil

MrPhil
  • Members
  • 5,241 posts

Posted 24 August 2012 - 01:14

If your store is installed in the main domain, any internal links (to other pages) will be to the main domain. With some SEO-style hacking, you could generate store.* links, and use .htaccess redirection to silently send them on to the main domain. You could change all the URLs in the configure.php files to use store.*, and then add an .htaccess redirect from store.* to the main domain store installation. This would not be a 301 or 302 redirect! Frankly, if it's important to have customers see store.*, I would reinstall the store into that subdomain and make it configured that way. In the long run, that will be cleaner and easier to maintain.

Do not use www.store... use just store... that's the whole point of a subdomain.