magento Every Product detail page showing 404 - magento

I have shifted from live site to local site, the product detail page is showing a 404 page. I tired re-index multiple time.clear cache. check database also but it still displays a 404 page.

There can be several things you can check:-
1. Check for url in core_config_data and also check cookie url.
2. Check on server for mod_rewrite module may be this is not enabled on local, this can also be the reason if you were using SEO friendly url.
Clear the cache once you are done with these. It will be great if you can tell how url for PDP page is been generated on local.

my url is like this
http://localhost/reyassoc/10x-a4-silver-diamond-brochure-island-stand.html
same it working on existing live site

Run below sql query
SELECT * FROM `core_config_data` WHERE path = "web/seo/use_rewrites";
See whether the value 1 or not, if the value is 1, try to change it to 0.
This value is for SEO friendly url, which removes index.php from your store url.
Also, you can replace your .htaccess file with default one in Magento root folder.
Your server may have problem with mod_rewrite module or its configuration, you may re-install it.

Related

Prestashop Url change

I have a problem,
I changed the url of my prestashop because I have a new url.
But now i have the Problem that i tipped in the wrong path, and if i want to log in as admin then the shop directs me everytime to the wrong path so I can't change anything...
Does anybody know in which folder of the FTP Server I can change it in the data?
I tired to delete the htaccess data but this didn't help me.
Or is it another option to go back to where I started, before i changed the Url?
I think that your problem occurred not from a .htaccess but from your database. Prestashop keeps domain URL in the DB and if you changed it you better to check table configuration fields PS_SHOP_DOMAIN, PS_SHOP_DOMAIN_SSL and table shop_url. I think that the problem is over there.
When you want to migrate to another server, you have to
Update the _DB_... constants in config/settings.inc.php file
Since your database does not changed, this step is not necessary.
Update PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL fields in configuration database table
Update the domain, domain_ssl and physical_uri fields in the shop_url database table
Now you can log in to the admin page. When you did it, your first step has to go to Preference -> SEO & URLs, then turn off and on again the Friendly URLs switch to update the .htaccess files.
These steps are works on Prestashop 1.6, but not tested on 1.7.
See the official blog post for additional details:
https://www.prestashop.com/en/blog/how-to-migrate-prestashop-to-a-new-server

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

Is there any way to replace "&" with "&" in Magento URL

Is there any way to to replace & with & in magento url.
Every time when magento URL is redirecting from one store to another it is adding & between the url. And the url is breaking. for eg:
https://www.indelust.com/designer?d=370
Above URL is the default url which is linked to US storeview based on US geoIP. When I am clicking on the url from Google search results it should redirect me to the same page with respective storeview. Now below url is the one when I clicked on google search result.
https://indelust.com/in/designer?___store=in_storeview&d=370
And the above link is breaking.
When I am making a small correction in the above url, by changing & to &. Then it is working fine for me.
I gone through some tutorials and below I found the relevant one, but I did not get the answer to resolve based on magento url pattern.
https://magento.stackexchange.com/questions/38513/amp-instead-of-in-language-switch-url
Can anybody help me?
You should find out why the issue appears, but if you just want to replace the url you should add this to your .htaccess file:
RewriteEngine On
RewriteRule ^(.*)&(.*)$ /$1&$2 [L,R=301]
An htaccess file is a set of rules a server runs through for each page request. Adding all of your old URLs to this file means that for every page visit your server has to do a lot more work - it has to compare the URL the user is visiting to all of the old URLs you have added to the file. Magento isn't renowned for its blistering speed, so slowing down every request seems like something worth avoiding
execute the following query in mysql (via phpmyadmin or command line) to see what the current values are:
select * from core_config_data where path like '%base%url%';
and then update accordingly
update core_config_data set value = 'http://myhostname/js/' where path = 'web/unsecure/base_js_url';

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

Resources