php - URL rewriting or redirection issue in magento -
i running site in magento
version 1.9.1.0 ssl
enabled. when open site's admin panel on browser either after refresh cache of browser or in private mode first time shows site's homepage rather admin login page i.e. sitename.com/admin
url redirects https://sitename.com
url automatically on first time.
same issue happened when try access inner page of site directly first time.
after when enter again url in browser's address bar sitename.com/admin
open admin login page on next time(seems cache works).
i using login , pay amazon
extension in magento site. when go login amazon after inject credentials shows me error follows:
no data received. unable load webpage because server sent no data on chrome.
secure connection failed on firefox
i using base urls (unsecured , secured https://sitename.com) in admin panel under system > configuration > general > web
seems right? have doubt in .htaccess
file part of code. have used following code in .htaccess
file:
############################################ ## workaround http authorization ## in cgi environment rewriteengine on rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri} rewritecond %{server_port} 80 rewriterule ^(.*)$ https://www.sitename.com/$1 [r,l] rewriterule .* - [e=http_authorization:%{http:authorization}] ############################################ ## trace , track http methods disabled prevent xss attacks rewritecond %{request_method} ^trac[ek] rewriterule .* - [l,r=405] ############################################ ## redirect mobile user agents #rewritecond %{request_uri} !^/mobiledirectoryhere/.*$ #rewritecond %{http_user_agent} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [nc] #rewriterule ^(.*)$ /mobiledirectoryhere/ [l,r=302]
my requirements are:
site open
https
working fine.when user access site either
www
or withoutwww
site openhttps://sitename.com
. , avoidindex.php
in url working fine.when access admin panel @ time either first or next first, should display admin login screen.
remove error occurring after login amazon.
kindly please me resolve issue. if other code required please let me know.
i think if place in .htaccess following rewrite, bypass magento stupidity; apache rewrite appropriately before magento chance:
rewritecond %{http_host} ^www\.domain\.com$ rewriterule ^(.*)$ http://domain.com/$1 [r=301,l]
Comments
Post a Comment