Magento 1.9 Navigation link to home page - magento

How would I make a link from the main navigation to the home page (or any other page)?
I can do it in the Admin using
Catalog -> URL Rewrite Management -> Add URL Rewrite
Then creating a Custom Rewrite.
I use the hardcoded link to the homepage http:\\somedomain\magento as the Target Path and set it to Permanent 301 Redirect.
Then I delete the original System rewrite for the home category.
This works until it's reindexed, then the original System rewrite for that category comes back and the Custom one I created doesn't work anymore.

I found out what I was doing wrong. I shouldn't have deleted the original system rewrite. These are the steps to make custom links from the navigation menu.
1) Copy the Target Path from the System Category rewrite
2) Change the redirect to Permanent 301 for the System Category rewrite
3) Create a new Custom rewrite.
4) In the new Custom rewrite, paste the copy from #1 into Request Path
5) For ID Path put the URL Key for the page to be linked, for default page is /
6) For Target Path put the path to the new page (e.g / or /contacts)
This article explains it in detail : http://go.magento.com/support/kb/entry/name/adding-page-links-in-the-navigation-bar/

Related

URL rewrites not working and keep changing the URL extension

I cannot get the URL rewrite in Magento to work correctly at all. I'm trying to redirect a category to a CMS page and at first try it works fine. After I refresh, it starts to change the URL extensions to something completely different than what's shown for the category URL. I've tried clearing the cache and reindexing the URL rewrite but that seems to change it again!
And if I do try to change the URL rewrite to this new, random, made up one that's being automatically inputted - it changes it again! I'm so confused here..
Fixing weird URL Rewrites
Sometimes when you make changes to your products, or enable a certain extension, Magento might start to rewrite all your URLs to include a suffix "-1" or some other number. Within the URL Rewrites, Magento differentiates between System URLs and Custom URLs. If the System URLs are broken like this, you should not fix this by adding new Custom URLs.
Instead, open up phpMyAdmin, create a backup of your Magento database, and flush the Magento table core_url_rewrite (so that it becomes totally empty). Immediately afterwards, refresh the Catalog Url Rewrites under Index Management. This will regenerate all System URLs.
You can also try to redirect through the .htaccess.
Redirect 301 /site-URL-to-redirect www.site.com/url-destination
There are two ways to redirect your category page to cms.
Using Magento native URL rewrite managment.
In Magento 1.x go to
admin -> catalog -> url rewrite managment -> add new url
select custom in Create URL Rewrite: drop down and then give your categoy url as request and cms page as target.
Using .htaccess file. Add this line of code into the file .htaccess:
Redirect category-url cms-page-url

Url Rewrite of a CMS page in Magento

As a new magento developer I'm using a theme to develop my store. I want to change the URL key of CMS page about. I followed the steps written here but I can't find my layout file for about page on the theme directory or base directory for change XML URL tag.
How can I edit the layout file? Can anyone help me?
Actually that tutorial is a little confusing because there, they are showing an example of changing a URL for two different type of pages (CMS and system).
For changing the URL of a CMS page, like about in your case, it's enough that you proceed until point 12. In short:
First. you change the URL from: (main menu) CMS/Pages/Your_Page -> Url Key: newURL
Then, find the blocks that it is used (e.g footer) and change the URL accordingly.
Plus, in general working in Magento after changing things like page URLs you need to do a reindex and in case of using cache you have to refresh/remove your cached data. Both could be found under System tab (Cache Management & Index Management).

Magento - How to create a custom url based on attributes?

In the Magento Admin > Catalogue > Attributes > Attribute Sets, we have a set of attributes for "Manufacturers" which group products under designers.
I am trying to create a hyperlink that maps a custom route to an attribute query like so
this is route i want:
{{base_url}}/designers/some-designer-name/
this is what it will map to:
{{base_url}}/?designer=136
I have tried creating a custom url rewrite under Catalogue > URL Rewrite Management with no luck.
Please refer this this may help you
http://www.atwix.com/magento/products-list-cms/
if you want to create custom url, than follow the steps...
From the Admin panel, select Catalog >> URL Rewrite Management
In the upper-right corner, click the Add URL Rewrite button
In the Add New URL Rewrite section, set Create URL Rewrite to “for Product.”
Find the product in the list below and click to open the record and click Skip Category Selection button
In the URL Rewrite section, do some following things:
a.In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
b.Set Redirect to one of the following:
Temporary (302)
Permanent (301)
For your own reference, enter a brief description of the rewrite.
click to save and enjoy ;)

Magento migration from single store to multistore. Redirects

I have 1 website for now. Its URL is www.test.com, for example.
I want to create second website on the same domain adding store codes to URLs. So my URLs will be
www.test.com/first/
www.test.com/second/
But as I can see all my previous URLs will show 404 on their open. So if I open
www.test.com/product.html
it will show 404. It is not good because I loose my SEO.
How can I create redirects so if user opens
www.test.com/product.html
he will be automatically redirected to default website, like
www.test.com/first/product.html
Shall I have any issues with such redirects? (Like API will not work)
Or is it possible for URL
www.test.com/product.html
to show product from default website, if exists?
Magento has a very good system for SEO.
For Rewrite Management these are the steps:
1.Loginto Admin.
2.Move mouse over Catalog and you will find a drop down.
3 Select URL Rewrite management.
Catalog >> UrlRewrite Management
4.Then click on ADD URL Rewrite Button.
5.Then on next screen select custom from option provided
Create URL Rewrite : Select Custom
Now following important fields and values that should go:
Request Path (Old URL ) Target Path ( New URL ) redirect (Permanent 301).
Note : This approach will be good if you have few products but if you have too many product then some .htaccess rule is recommended.

Magento 1.7.0.2 Index Management overwriting URL Rewrites

I have a slight problem with the Index Management on Magento 1.7.0.2.
I have quite a few custom URL rewrites for categories.
When I re-index the Catalog URL Rewrites it deletes all of my custom rewrites for the categories and sets them back to the system default.
Before re-indexing: http://i.imgur.com/4s1oo.png
After re-indexing: http://i.imgur.com/0U8zE.png
Also on a side note, What are the differences between cache management and index management?
Any help is appreciated, thanks.
Magento is changing those because you didn't change the id_path. If you specify different id_path value for your Custom Category rewrite, Magento will not overwrite it.
Also what you want to achieve could be done with Custom Url Rewrite. For example:
request path: catalog/category/view/id/118
target path: 'corporate'
In this way you're making a destination of system rewrite yours start point.
This was driving me absolutely bonkers until I figured out a nice little work-around.
I create my new object (in my case it was a category for the top nav
I go to URL Rewrite and note the ID Path of the new category
I delete the system generated URL Rewrite
I create a custom Rewrite specifying the ID Path of the deleted object, The request path, and then the path to the desired URL
I then go to phpmyadmin > core_url_rewrite and find my newly created custom Rewrite
I change the store_id to 0 (not changing anything else)
I then go back to Magento and run a reindex. This creates a new system generated Rewrite with a higher url_rewrite_id (see in phpmyadmin > core_url_rewrite table)
I then create my page with the desired path
Reindex / flush caches and presto.. my top nav now has a menu item to my new page.

Resources