Magento multistore issue when switching from secondary store - magento

I have set up 2 stores under one Magento installation using this method:
http://webdevster.com/ecommerce/magento/magento-multiple-store-setup-instructions
Each store has it's own URL ie. http://mainstore.com and http://secondarystore.com (add on domain in cpanel)
If I navigate to to mainstore and then switch to secondarystore using the store switcher everything works as expected. I can log in on the secondary and remain there.
The problems arise if I navigate directly to secondarystore in the beginning. If I do this and then try logging in I get automatically redirected to http://mainstore.com/customer/account/login/
Does anyone know why things only work correctly if I navigate to http://mainstore.com and then switch to the secondary store?
EDIT:
I've noticed that if I access the secondary store using secondarystore.com?_store=secondstore instead of just secondarystore.com it works perfectly. Anyone know how to get the same results without needing the ?_store=secondstore?

You need to setup seperate Apache vhost entries for each URL. You use the same document root for both. In each one, you should have a set of lines like:
SetEnv MAGE_RUN_CODE=base
SetEnv MAGE_RUN_TYPE=website
Change 'base' with the actual website code you set in the admin for the second site.

Related

Multiple Custom Admin URL

im trying to have the same backend but with multiple subdomains. first i created one of my subdomains in the backend has showen in this image above.
And is working fine, but not i need the same backend with another subdomain for example "sync.mydomain.com", but i cant find any information on magento docs in configuring custom admin url in multiple domains. Does someone have any idea if it is possible to configure it on magento?
In order to make magento work with multiple domains, you need to make few steps.
System->Manage Stores -> Create Store Fill in the store fields,
taking care that the Website and Root Category are the same as your
primary site.store. Save Store
Create Store View Fill in the store view fields, change Store to the
new store you just created, give your store view a Name (spaces ok),
a code and make sure it’s enabled, after that save the store view.
System->Configuration->Web Change the scope on the upper left to your newly created store view
Change Unsecure->Base URL to your second domain (You’ll have to uncheck Use Website)
Change Secure->Base URL to your second domain (You’ll have to uncheck Use Website)
Save Config
Open the .htaccess at the root of your Magento install
Add the following, obviously changing the values with your own:
SetEnvIf Host www.mysecondarydomain.com MAGE_RUN_CODE=yoursecondarystoreviewcode
SetEnvIf Host ^mysecondarydomain.com MAGE_RUN_CODE=yoursecondarystoreviewcode
Clear the cache and re-index the site.
Here is the article for more information:
http://madproject.com/programming/magento-one-site-multiple-domains/

Joomla 1.5 install without domain

So, I installed a new joomla 1.523 (via Fantastico) on my server, but event though I have the domain name set, I haven't registered it yet. Now I need to acess joomla, and I can't.
I already did this with a Moodle server, and I know I had to change a config file to set the url to the IP. So basically I should acess it with:
http://190.190.190.190/~user
(This ip doesen't exist, just making an example).
But I always get an error trying to acess it, even though I get redirected to:
http://190.190.190.190/~user/installation/index.php
Anyone know what I need to change to get this to work?
(I tried messing around with the configuration.php file in the root of my server, but there is nothing there like a url path variable to change, I think)
After installing Joomla, the installation folder needs to be removed (or moved, or renamed), otherwise any access will be redirected there.

why my IgnoreRoute does not work?

I want to prevent users access for my "~/Content/..." folder I wrote it as follow in "Global.asax.cs" and put this line of code at the top of every other routes
routes.IgnoreRoute("Content/{*pathInfo}");
but it does not work. in fact user can see every files in content folder by type the URL in browser.
am I missing something?
How did you figure out that it does not work? Give example.
You may have put it last in the Routing table. So try to move it up so that it gets added to the routing table first. The route collection is an ordered list of routes.
Also try this : Routes.IgnoreRoute("Content/");, but your version of ignore is also correct and it should work.
Lastly, I do not know what you mean when you say the user can see all the contents of the Content folder : Isn't that the point? User must be able to download files from the folder, and we usually just need MVC to ignore the requests from coming into the framework, and so that IIS can directly serve those files.
or did you mean Directory browsing is enabled, and you want to disable that : In that case go to IIS manager, and select your website and look for the Directory browsing option and disable it as shown here.
Your problem cannot be solved by routing constraints. There are 3 significant steps in processing request:
IIS got request.
IIS watch at filesystem and search for direct correspondence to file
If IIS didn't found any file - it gives request to ASP.NET MVC for processing.
So, you need to configure folder security to forbidden direct access to files, but allow access to application, as here.
But I don't recommend to secure folder, that should be shared. I don't believe that your site shouldn't have images to display :) If you have some secured content, you need to create another folder.

Magento Admin login kicks me out back to the Admin login

After I enter my username and password and click "Login" it sends me back to the Login page with NO error messages. The URL changes to include a session key and that's it. Everytime I click Login again, the session key is regenerated and I still can't log into the admin interface.
I just encountered this problem on one of my servers (not a localhost installation). Turns out the system account was over quota, so I presume Magento was unable to create the necessary temporary files. (I noticed this when trying to create a directory on the server over ssh.)
So... maybe check to make sure the account under which Magento is running isn't over quota on your server? At the very least, it might not be a Magento problem directly.
Clear the contents of the directory var/cache and try again.
If that doesn't help check the table core_config_data in the database for records with a path value of "web/secure/base_url", "web/unsecure/base_url" and "admin/url/custom". These should match the page you are trying to log into (but without "index.php/admin/" at the end)
Finally check your browser's cookie settings and that the server's PHP is able to set cookies.
I was having the same problem running Magento 1.5.1 on my production server. I would log in to the admin, the url would show the address for the dashboard (with the secure key), but the screen would still be the login screen. There was no error. This happened with FF, Safari, and Chrome.
I fixed it by manually setting two core_config_data values in the database. They are as follows:
web/cookie/cookie_path = /
web/cookie/cookie_domain = "mydomain.com"
clear out var/cache and try to log in. For me, it worked.
Version 1.7.0.2 I have been moving my magento store from on server to another one, and I had the same problem. Use phpamdin to edit your database on new server, search for web/cookie/cookie_domain in 'config path row', the value is probably your old domain name: yourdomain.com, change that to your new domain name OR to your new IP address (new server). If you attend to use your old domain on new server environment you will probably want to set your story ready before you switch your name servers. That was the case for me, after I added my new server IP to web/cookie/cookie_domain instead of domain I was finally able to log into my magento backend.
I had some problems when on a local server. It was on http://server/username/ and so didn't have dots in it. If we changed the settings to be the IP address of the server then it was fine.
There can be several things that cause this behavior. This is my checklist. One of them will eventually fix it.
Click the "forgot password link" and then the "back" link. This will remove any possibly misplaced params in the URL as well as make sure you're on the right server (some installations have separate admin servers)
Clear cookies or use an incognito window
Try another browser
Local installations: Try using 127.0.0.1 instead of localhost (and update the base URL in the core_config_data table)
Clear Magento cache, full_page_cache, and session directories in the magento/var/ directory (and repeat 1 and 2)
Truncate the core_session table
Verify your Magento has correct memory settings
Check Magento system.log and exception.log files and debug
Check PHP's error logs and debug
I've experienced this issue using Opera, while in other browsers it worked fine.
Also, make sure to set correct cookie options in:
System > Configuration > Web > Cookie Settings
Also, make sure that your system time / time zone on the server and php and magento match up.

Troubles after installing Two stores with same php docroot

I am trying to setup multiple stores within same hosting account and I studied many interesting guides out there on the matter.
Seems to me I figured out simplest solution for me - map both my dot com sites onto the same directory on host, and modify .htaccess to launch different website depending on URL, like so:
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_CODE="anatscraftonia";
SetEnvIf Host .*anatscraftonia.* MAGE_RUN_TYPE="website";
My first store works fine, but when I go to anatscraftonia.com , all I get always is a Magento 404 page.
I checked all settings, multiple stores are defined and code above is copy/paste from Admin console under Website I added. I have Home page enabled for All Stores and Base URL redefined for both Secure/Unsecure. I also tried changing website to store, with no improvements.
What else am I missing? How do I even know what page is it trying to go to, or whether it even gets “no-route” or just totally whacked…
I threw together some quick and dirty code a few years ago to log the controller dispatch process in Magento Community 1.3x.
http://alanstorm.com/magento_controller_dispatch_logging
I don't think you'll be able to drop those files into a current installation, but it should give you an idea where to stick some logging functions to see why Magento is routing to a 404.
I am not 100% sure what you are trying to achieve but why not use a single instance of magento to handle both stores and magentos own multi store capability..
full details here http://dx3webs.com/front/2010/08/magento-multistore-setup-under-plesk/ post contains links to cpanel instructions as well.
the instructions are for multiple domains but will work with sub folders

Resources