Magento - home page url - magento

i have a two store magento installation, and i have a problem with home page's url: in both stores the home is a cms page, in cms.xml layout the route for that is cms_index_index. this seems to be a problem in one of the stores, which has a complete different layout for logged and non logged users: after loggin in, the url from www.mystore.com becomes www.mystore.com/index.php/cms/index/index/, if i logout the url remains www.mystore.com/index.php/cms/index/index/. i need that the store url remain www.mystore.com. how can i do that? is something that could be done with xml or other magento configuration or is something related to other (e.g. apache, rewrite,...)?
thanks,
Luke

The problem probably lies in the template files.
There are different ways of getting the homepage url (and it's probably using one that's not helpful for you).
Here is the correct call that should be made from the templates:
Mage::getBaseUrl();
This call can be done from anywhere - just make sure to echo it.
Pesach

Related

*some* magento links pointing to old domain

I have just moved a magento site from one domain to the new one. Steps so far...
Backup the database and restore the database on the new domain. Change the core_config_base table for secure and unsecure base urls
Upload source files
Update the local.xml with new database information
Cleared cache
Now I can go to the site and everything is showing up fine on the new domain. The main navigation is working as it should. When I click on a product, however, it goes to the old domain. Does anyone know why this might be happening?
Can you verify the links when you hover products are correct or in correct consistently? Is old base URL in all links I mean. Also check htaccess file for any directives containing the old domain. Also check to make sure no custom URL rewrites exist in the Magento admin Catalog → URL Rewrite Management .Once you verify htaccess or custom URL rewrites in Magento admin are not causing it, I can suggest other procedures to fix.
Probably your previous developer didn't follow all Magento standards while coding.
My suggestion is download your code and search for strings that equates to your previous domain.Also check in data base, as use of CMS blocks too might result in previous domain links.
Btw make sure you delete all caches
Rm -rf var/cache/*
Verify base URL and secure URL are correct in all scopes via drop down in Magento system configuration.

Magento home page

I am working with a Magento install that I did not set up and am pretty green when it comes to its operation... There is a default page serving as the "home page" when there is already a page defined in the back-end as the "home page". The path in the URL reads as: DOMAIN/index.php but when I try to find said index file using google developer mode, I can find no such file that would generate the layout. I suppose I just don't have enough overall knowledge to figure out what is at work here. Can someone help me figure out why it's using the default home page instead of mine?
On most webshops I've worked on the CMS home page wasn't really used. Instead of the CMS home it can be easier to use a custom template to setup the homepage with static blocks and what not.
If this is also the case for you, there might be two places you can find this custom template:
In the layout xml files, search forcms_index_index?
In backend, navigate to the CMS home page and go to the Design tab
About the index.php part: this is because you probably because you haven't enabled mod_rewrite in your server configuration

Magento Admin URL 404

I know that that similar issues and topics exist, however my issue differs slightly and none of the proposed fixes have worked.
I was accessing the Magento backend as normal. Approximately 10 minutes after that I could no longer access the Magento backend.
What I mean is that when I go to the admin url login page, I get a 404. However the 404 isn't generated by my host, it's generated by my webstore.
Everything about my webstore works as normal.
I've seen a number of fixes, mainly this one...
http://www.magentocommerce.com/boards/viewthread/207981/#t274443
I have a few main issues.
Admin Custom URL had been set (but not by me). It was set over a year ago when Magento was installed. It worked entirely fine until today.
I do not even have "admin/url/custom" and "admin/url/use_custom" in my "core_config_data" PHP table. It simply does not exist so I cannot change it. I looked manually for it and did a search for it. Nothing.
I tried updating the local.xml file and clearing "var/caches" and "var/sessions" but that did not work either.
I've been working this for hours and it's beyond frustrating. It's imperative that this be fixed ASAP because we are a fairly sizeable company.
Thanks ahead for helping. Anything at all would be appreciated.
First Check your Apache configurations
I know that you said you were only in the Magento admin but I would first check that apache was configured correctly. This is the first point of contact and you need to ensure that it's working right.
You need to locate a default Magento htaccess file that you can upload to your server. There's additional configurations that you need to make if you're in a subdirectory and also check to make sure that your mod_rewrite is working properly. There's an extensive tutorial on these things here, magento htaccess.
Make sure that you have the right magento admin url
I have to assume that you know what your magento admin url is, but of course I would double check that you're getting it right. There is an option in the admin area to change the admin url, you could have adjusted that on accident.
You say that you don't have "admin/url/custom" and "admin/url/use_custom" in your core_config_data table. This actually means that you didn't set the magento admin url from the admin area. However there is a third place that you can look for your admin url. This is in app/etc/local.xml but you couldn't have changed this from the administration area.
Did you turn off search engine friendly urls?
If you had been accessing your administrative area using /admin and then accidentally turned off SEF urls, then your admin area could have just simply moved to /index.php/admin. Of course you mentioned that you have a custom admin url, but I don't know what that is, so I'm giving examples with the default.
I can't really give you any more suggestions without more information. I hope that this helps!
Found this and thought I would post here since it shows up in google.
http://sourcelibrary.org/2011/05/19/magento-404-page-not-found-error-for-admin-panel-access/#comment-8444

Magento Homepage Keeps on redirecting to a 404 page

I have been on this issue for almost a week now and have been research all over the net for answers but i could not find one.
Problem:
each time i access the homepage of my site, it results to a 404 error.
ex.
http://www.domain.com ---> redirects to 404
http://www.domain.com/home ---> enters to the cms page that i set as my homepage
I have already run the magento cleanup scripts but it was not able to solve the problem.
ERROR MESSAGE:
Whoops, our bad...
The page you requested was not found, and we have a fine guess why.
If you typed the URL directly, please make sure the spelling is correct.
If you clicked on a link to get here, the link is outdated.
What can you do?
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
Go back to the previous page.
Use the search bar at the top of the page to search for your products.
Follow these links to get you back on track!
Store Home | My Account
I've got a similar error and would like to post my solution here. The case was exactly the same for me: all the pages, categories, etc. worked perfectly, but the home page showed a 404 error.
I looked into the core_url_rewrite table and discover that there was an entry with the «request_path» field empty. So this entry was rewriting my base url and that was the reason for the 404 in my case. I just deleted it.
Hope this helps to other people.
If you are using the Enterprise version you should check the table enterprise_url_rewrite. The query below should help you:
select * from enterprise_url_rewrite where request_path="";
delete from enterprise_url_rewrite where request_path="";
Check the folowing:
1- System->Configuration->general->Web->secure
Base URL: http://www.your-site.com/
(be sure you are in the right shop site from the top left of the system)
2- System->Configuration->general->Web->Default Pages
Default Web URL: cms (yes just cms)
CMS Home Page: select your cms page
Default No-route URL: cms/index/noRoute
3- check your server has rewrites otherwise
System->Configuration->general->Web->Search Engines Optimization
Use Web Server Rewrites: No
4- something wrong with your .htaccess replace the file with the one in your original installer.
Because StackOveflow has this stupid rule that I must have a certain number of "points" before I can chime in on discussions I need to make this as a "new answer":
open-ecommerce.org's #2 also solved the problem for me
2- System->Configuration->general->Web->Default Pages Default Web URL:
cms (yes just cms) CMS Home Page: select your cms page Default
No-route URL: cms/index/noRoute
for me this was set to "index". No clue how it worked before, or why it was set that way, but after updating it broke and this was the fix for me.
Note that I did also truncate the 'core_url_rewrite' table as well in troubleshooting. If you don't change urls at all, or often, then that's no big deal. But if you are chaning URLs often, then you'll loose your 301 redirect history (all old urls will 404 going forward).
Open-ecommerce.org solution # 2 , worked for me.
I initially set my "Defaul Web URL" as the URL of the homepage. Similar to what I did with the baseURL but I was wrong.
I changed it to "CMS"
From there, it all works.
Thanks!

Set up a cms page for Magento

I've been trying to set up a CMS page in magento to be the home page, and it's just killing me - how hard should this be? no matter what I set up, I get a 404.
Can somebody tell me basic steps to set up a CMS page as the home page for a Magento install, living at:
http://www.mymagentoinstall.com/
I can't have the url key for the CMS page be empty, but setting the default page in the System->Config->Default Pages->CMS Home Page (which seems like it should work), still gives me a 404.
thx for any help
Hours of head banging later .... I’ve changed the parameter “Use Web Server Rewrites” on System -> Configuration -> Web from Yes to No. And it worked! My provider set this by default, so had to change it. Only downside is that I now get the /index.php extension added.
Did you check to make sure that the page was enabled and visible in your store view?
Ok - figured it out. In the System->Config->Web, the Default Web URL needs to be 'cms' (no quotes) - I guess that tells Magento to use the cms page instead of a default url.
In csm - pages create some html in the page, eg start simple with My Homepage.
Give it a name and take care the url is "home" (without the quotes.
Now go to system - configuration - web and select your homepage (name) from the dropdown where in lets you choose the homepage.
That should do it.
Your CMS Page Identifier should be home
I was running into the same issue. No matter what I did, the home page came back as a 404. I had it working on a test server (with a different database) and compared the options side by side. Absolutely nothing worked, the home page, named 'home' and the 'cms' was properly set, mod_rewrite working, htaccess file just peachy...but domain.com/ wouldn't work. after a few hours I saw that domain.com/home/ did, though I swear it hadn't been.
Finally I wiped the blood off the keyboard where I'd been smashing my head against it and went into url rewrite management and set id path to '/', request path to '/' and target path to '/home/' and it works like it should have all along. Hope this helps someone else!

Resources