Magento 1.7.0.2 Index Management overwriting URL Rewrites - magento

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.

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

SEO : URL structure in magento

Currently I have a online store in magento.
I am using the url structure http://sitename/categoryname/productname
if I will change it to http://sitename/productname is this will be helpful to index ?
The main thing is that my site is doing well now but on search unique product page urls are not showing on google search. If I will change it then how it will be impact on site?
How can i do this without any bad impact? Please help..
Yes if you have Same product in multiple categories. It creates duplicate content issues.
By remove category path from the URL, It will help you to make your products URL unique for all categories.
You can manage this from backend configuration. In backend From top Navigation go to System >> Configuartion >> Catalog.
In Search Engine Optimizations Group, Set No to Use Categories Path for Product URLs. Reindex Catalog URL Rewrites.

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).

*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 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.

Resources