Multiple URLs for magento store? - magento

Quick question-
Noticed a problem on my Magento 1.7. Consider the site http://www.seacadetshipsstore.com/magento/. This site has a sub-store that's /magento/gearlocker/. The two should be isolated - if you go to /magento/gearlocker/, you shouldn't interact with the generic store at /magento/ at all.
Here's the problem: the store's base URL is set explicitly to http://www.seacadetshipsstore.com/magento/gearlocker/. When users navigate to http://seacadetshipsstore.com/magento/gearlocker/ (no www), they get redirected to http://www.seacadetshipsstore.com/magento/.
My question is this: if a user navigates to the gearlocker site without www, is there a way to set a second store URL to prevent a redirect? Or would it be easier to control that redirect back to /magento/gearlocker/, instead of /magento/? Any thoughts, solutions, or references would be greatly appreciated. Thanks!

See my comments above. Thanks #CodeMoose
RewriteEngine On
RewriteCond %{HTTP_HOST} ^seacadetshipsstore.com
RewriteRule (.*) http://http://www.seacadetshipsstore.com/magento/$1 [R=301,L]

If I remember correctly I believe duplicate urls across multiple stores are not possible without one of the urls being auto incremented with a -1 -2 etc. Please try modifying one of the url keys and let me know what happens.

Related

Can I create a 301 redirect from www.xcompany.com to shop.xcompany.com?

I work for xcompany. I am wondering if it is possible to set up a 301 redirect from our site http://shop.xcompany.com/ to our site http://www.xcompany.com/ and if possible, what would the rewrite rules be?
The old page that existed on the former URL has been removed from the site and a similar page has been created on the latter URL and we need to make sure any traffic is directed to the new page.
Thanks!!
RewriteRule ^old/URL/path$ http://example.com/new/path [R=301,L]
To redirect from oldsite.com to newsite.com you can use the following redirect in /oldsite/.htaccess
Redirect 301 / http://newsite.com/
Redirecting one domain to another domain is very much easier than before only if you are well familiar with CMSs like WordPress. There are plenty of redirect plug-ins available in WordPress that make our efforts easier and quicker.
301 redirection must be done if you have made any changes to the older URL and it will give link juices without losing its ranking, backlinks, and all others.
You need not worry about anything. Redirect your older one to new one. Then Google webmaster tool will give a report if your new site causes crawling errors. Hope it'd be helpful.

Redirecting from one domain to another with mod_rewrite

I've set up a site for someone that has a URL like:
www.flowers-oakville.com.
But they'd also like www.flowersoakville.com to land on the page.
The question now is, what is the best way to redirect from www.flowesoakville.com to www.flowers-oakville.com. I don't want the user's browser to show the redirection by showing the new URL in the address bar so I think Apache's Redirect command is not the solution. Plus, the Apache Redirect would take an extra trip to the browser and back that I'd like to avoid. So I think the solution needs to be a mod_rewrite, which as I understand it, does everything within the server so the round trip is avoided and the user's address bar is unchanged.
But after reading through a few mod_rewrite tutorials, it seems that mod_rewrite is mainly for redirecting files, not an entire website. Is there a simple way to do this?
Thanks for any help.
I would do this at the domain level and ensure you are using relative links or an environment variable for the hostname in the website.
Add www.flowersoakville.com as a CNAME record pointing to www.flowers-oakville.com.
This will then serve the same website, but retain the domain name as the user entered it, unless you have explicitly linked the actual domain in a link somewhere in the site.
If mode_proxy
is enabled on your server, you can use mod_rewrite (the following code) in your .htaccess file to redirect a domain to another domain without changing url in the address bar.
Try adding this to www.flowersoakville.com/.htaccess file :
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?flowersoakville\.com$ [NC]
RewriteRule ^ http://www.flowers-oakville.com%{REQUEST_URI} [L,NE,P]
Note : The example above will not work if proxy module is not enabled on your server.
I wanted to pass on my experience trying to use Dwev's answer. It turns out that the DNS Manager running in my virtual server (I'm using eApps as my hosting provider) does not support "domain based redirection." That is, the left side of a CNAME record has to be in that domain. So when trying to build a CNAME record in the flowers-oakville.com record that points to flowers-oakville.com, the left side has to be xxx.flowers-oakville.com where the xxx might be something like www. I can't get the left side to be flowersoakville.com, even though flowersoakville.com is one of the domains my server is listening for.

Joomla back-end needs two times login? Why? [duplicate]

This question already has answers here:
Why do i have to log in twice in backend to log in?
(2 answers)
Closed 9 years ago.
My login problem is reproducable on different Joomla sites.
I have this for a Joomla version 2.5.9 and 3.2.
Backend users need to put my username and password in twice to get logged in.
Are some users experiencing the same? Can someone explain this?
First login at: http://my-domain.com/administrator/ For some reason, nobody can login here. This page get redirected to the second page:
Second login at: http://www.my-domain.com/administrator/ Login is possible here.
So, I need a WWW in the URL. But some users keep going to the other page. Is this Joomla related? Hosting partner related?
On my other website, I have the reverse problem.
Login at: http://www.other-domain.com/administrator/ does not work.
Login at: http://other-domain.com/administrator/ is the redirect page and works.
There is one post with a user having the same problem, but I did not find the usefull answers: http://forum.joomla.org/viewtopic.php?t=558305
Thanks! Any help or explanation is useful. I realy need this explanation for my customers.
The login problem was related to my domain configuration and the interaction with Joomla.
I updated the .htaccess file like:
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
In this way, my users always get redirected to: www.domain.com
Even coming to domain.com
This give them direct access, but is also beter for other plugin's and modules that use web-cloud services, depending on the www.domain.com (they will not work on domain.com)
Examples: Social Login with Google/Facebook/Twitter; Map API's and other API's
I hope this will help some users! It helped me :-)
This can be caused through a conflict between a redirect in the .htaccess settings and the $live_site parameter in the configuration.php file.
For example, the $live_site parameter in configuration.php may be set to the non-www version of the website while a redirect in the .htaccess file may be redirecting the www version of the website or vice versa.
Either make these consistent or don't set the $live_site parameter. Setting the $live_site parameter is usually not required for a website in the root folder on properly configured hosting unless there is a particular requirement (e.g. sh404SEF or similar).

Wrong redirection to old site after Magento's duplication

I’ve got this problem: Magento redirection problem after moving
I changed local xml, deleted cache, changed secure and unsecure link, everything… It doesnt’ work. The only difference is that I duplicated my installation on the same server and I changed subdirectory’s name for the second installation. But I tried also on another server and is almost the same, except for the fact that it keeps linking me back to Google, and not to old domain.
I noticed that if, on the other server, I don’t change subdirectory’s name everything works (and I don’t understand why) but I want on the same server 2 identical installation with 2 identical databases. How can I? What’s the problem? How can I avoid this wrong redirect?
Magento relies heavily on caching. I've noticed in the past I've had to clear my browser internet cache before the redirects updated.
Also if you cloned/duplicated the code & database, its likely you will have the old URL's in the rewrite module. Have you tried reloading all the indexes after moving and changing the URL's in the magento configuration?
Worst case you may have to change the URL in the core_config_data table in the database.
There is no reindex required for base_url to be taken in account.
Only cleaning cache is required. Are you sure you did it well ?
What cache system are you using ?
What did you changed in your local.xml for this ?
Are you sure you didn't left old information in a local.bak.xml for example ? Magento reads every xml file in /app/etc
I have encountered this when moving, and it ended up being that my .htaccess file still had an old rewrite rule pointing to the old domain. In case someone else has this issue for which the other suggestions to not apply, look for something like this:
RewriteCond %{HTTP_HOST} !^www\.localhost\.com$ [NC]
RewriteRule ^(.*)$ http://www.localhost.com/$1 [R=301,L]
and make sure obviously that the localhost.com matches your domain (the above simply redirects with a 301 permanent redirect rewrite any request that does not begin with www.localhost.com to http://www.localhost.com/ (such as the non-www localhost.com)

More Mod_rewrite problems

Ok, have a client that has existing links coming in from searchmarketing. I am in process of migrating the program from Cold Fusion to PHP.
RewriteEngine on
RewriteRule ^cat_ap~([^~]+)~(.*)\.htm$ /urban/cat_ap.php?$1=$2 [R]
Currently I have a URL structure:
http://www.test.com/urban/cat_ap~nid~5964.htm
which the above rewrite rule changes to
http://www.test.com/urban/cat_ap.php?nid=5964
Now I want to be able to get the variables out of the query string but maintain the url in the browser to the original http://www.test.com/urban/cat_ap~nid~5964.htm but still have it go to the PHP page.
So that when someone goes to http://www.test.com/urban/cat_ap~nid~5964.htm it actually goes to http://www.test.com/urban/cat_ap.php?nid=5964 but still shows http://www.test.com/urban/cat_ap~nid~5964.htm.
Any ideas on how to do this?
Thanks
Mike
You are already doing this on this line (but change the R flag to L):
RewriteRule ^/urban/cat_ap~([^~]+)~(.*).htm$ /urban/cat_ap.php?$1=$2 [L]
The URL that the user hits will still show as the .htm version while the server processes it as the .php
The R flag explicitly induces an external redirect. So just remove the R flag.
I think you'll need to set up reverse proxying to achieve the desired behaviour, and use the P flag with your rewrite rules. I've used a site with this sort of configuration before, so can say that it works, but I'm afraid I've never configured it myself :-(
A good first step at least would be to install mod_proxy and get it loaded and running. The mod_rewrite cookbook page on the P flag has a small amount of detail on proxying RewriteRules, and links through to the ProxyPassReverse directive documentation at apache.org.

Resources