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).
Related
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.
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.
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.
Please help with mod_rewrite subdomain to some Symfony2 routing. It is like 3 months now I spent time to solve this with my Symfony2 project but after reading tons of apache mod_rewrite and mod_alias documentation and trying hundreds of examples... it still doesn't work!
What I try to solve is, when user enter address of some specific subdomain:
XXXXXXX.example.com
He sees content that is actually under
www.domain.com/tag/XXXXXXX/
but he is not redirected or URL isn't changed -- it should just stay XXXXXX.example.com as he enters.
I need to resolve this with Apache VirtualHost and sites-enabled file (not with SubdomainListener) but the most I can solve on my own with mod_rewrite is having
XXXXXXX.example.com
Rewriting (transparently) itself to
XXXXXXXX.example.com/tag/XXXXXXXX or
XXXXXXXX.example.com/app.php/tag/XXXXXXXX/
which of course is not what I try to achieve. I try to achieve internal (http://httpd.apache.org/docs/2.2/rewrite/remapping.html) redirection so user don't see that. Any help with working soultions would be otherworldly appreciated.
Since this commit, you can use subdomains in Symfony natively, but unfortunately it's a Symfony 2.2 feature. If you need subdomains, this still is the best way to do this, however.
I'm trying to install SilverStripe and during the installation, it returns an error saying that friendly links aren't working. However mod_rewrite is enabled and AllowOverride is set to All. I'm using CentOS Linux on a dedicated server with Webmin as the cp (yes, I know.. not my choice).
The installer should have set things up as best it can, even if you receive that error message.
This question is a little tricky to answer because the problem could lie in a number of different places, but I've tried to put together a troubleshooting guide below.
Note: Many of the links below have been deliberately broken because Stack Overflow think I might be a spammer. ;-)
Assuming that your site is at http:/www.example.com, try visiting http:/www.example.com/dev/build - you should see a page with a heading "Environment Builder (formerly db/build)". If that works, then you have no problems with rewrite, and the installer gave you that message in error.
If that gives you a 404, try http:/www.example.com/sapphire/main.php?url=dev/build - this will visit the same feature, but bypasses mod_rewrite. If that gives you the heading "Environment Builder (formerly db/build)" and the previous URL didn't, then you have a problem with mod_rewrite and not some other problem.
Check the content of your .htaccess file. It should look something like this but may have RewriteBase line.
Try putting some junk text - e.g. 'asdfsahjadsfasdf' - into the .htaccess file and saving. Open your site. Does it give you a 500 error? If not, then your AllowOverride All setting isn't working. Check that you have set it in the right place. Remember - it needs to be in your Apache config file, and not the .htaccess. If you don't have access to the relevant config files you might need to ask your ISP to help you answer this question.
If that doesn't uncover the issue, we'll have to tinker with the rewrite rules to see if we can explore what's going on. Try changing this line:
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
To this (it will turn the rewrite rules into redirection rules):
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L,R]
Visit http:/www.example.com/dev/build again Did it redirect anywhere? If not, then mod_rewrite isn't working. It should be redirecting to http:/www.example.com/sapphire/main.php?url=dev/build. Is it redirecting somewhere else? For example, has extra junk been inserted into the ?url= parameter? This can sometimes happen if you are running SilverStripe in a subdirectory. In this case, check that the RewriteBase setting is set that subdirectory. Something like RewriteBase /mysubdir.
If you're still unable to get friendly URLs working, then congratulations - you've found a really nasty edge-case! Post the details of what you discovered following the steps above to the SilverStripe IRC channel or Forum on www.silverstripe.org.
Step 1. Put some garbage in your .htaccess file and see if the web server gives you an error.
The point here being to find out - assuming the server is running Apache - whether the .htaccess file the SS installer generated is actually being read. If you've still problems, try asking on the SS IRC channel.