Magento 1: Ajax URL returns 404 in a custom module when moved site to another server - ajax

I'M bit new to Magento development.
I just moved website to another server and the ajax call start return 404.
Could you please help me how to debug or resolve this issue ?
Orignal site (working fine)
Click on any product here in shop now section
Website URL: https://mastermindcrate.com/
Ajax URL is : https://mastermindcrate.com/waytwoexpert/index/getProductDetail
Moved Site (Error exist here)
I moved site to : http://yasirjamal.com/demo/mastermind-new/
Ajax URL is: http://yasirjamal.com/demo/mastermind-new/waytwoexpert/index/getProductDetail
When i click on any product shop now section here it returns 404 see screenshot here:

You have to remove index.php from secure frontend url otherwise you have to use index.php in your url to access specific route
For eg.
http://yasirjamal.com/demo/mastermind-new/index.php/waytwoexpert/index/getProductDetail

Related

Https error with prestashop homepage

I have a problem. I activated https on my ecommerce website prestashop and made all the settings and the security lock appears on all pages of the site except the home page. voci the link of the site: https://ivoirehorloge.com/index.php
The two CMS content on the right side of the page "Découvrez nos horloges" isn't using https for the two images :
http://ivoirehorloge.com/img/cms/4_1.jpg
http://ivoirehorloge.com/img/cms/5_1.jpg
If you look at your browser debug console, you will see a message like :
Mixed Content: The page at 'https://ivoirehorloge.com/index.php' was loaded over HTTPS, but requested an insecure image 'http://ivoirehorloge.com/img/cms/5_1.jpg'. This content should also be served over HTTPS."

How to redirect old url to new url in MVC

I am facing a problem in redirecting old urls to a new one.
There are many old links on social media and other sources that I need to redirect to the new URL when clicked or else they will display a 404 page not found error.
I have tried adding a new route in RouteConfig.cs file, but when an old link is clicked i get a 404 page not found error.
routes.MapPageRoute("OldArticleRoute", "Article/GetArticle", "~/ViewArticle.aspx");
Article/GetArticle - Article is the Controller and GetArticle is the ActionResult.
http://something.com/ViewArticle.aspx?d=Educational&a_id=32
To:
http://something.com/Educational/32

Magento site redirects to home page when ssl is enabled

I am using magento 1.8.1.0 and i have enabled SSL. SSL is purcahsed from Godady and is installed and configured at the server.
I have also set the Base URL in secure section to https://..... . Now when i enable it for front end, and then when i try to go to customer login page (which is served by https), i am always redirected to home page.
I have applied a few fixes, but no one worked.
The fix described on the below link starts a redirect loop and the site never loads.
Magento HTTPS on all website: urls redirect to homepage
Also i have read the following:
http://www.aschroder.com/2012/07/magento-ssl-offloading-with-amazon-elb/
https://magento.stackexchange.com/questions/38250/ssl-issues-with-magento-behind-load-balancer-302-loop
http://blog.ideaday.de/max/2012/12/magento-https-redirect-loop-ssl-offloading-proxies-pound-nginx/
https://www.sonassi.com/knowledge-base/magento-kb/magento-https-redirect-loop/
http://magentocoder.jigneshpatel.co.in/magento-redirection-loop-problem-after-installing-ssl/
And no fix is working for me.
Now i am offering a 50 points bounty for the correct answer.
Can someone give me some idea how to fix this issue?
Thank you
I saw this problem while on a login form submitted via ajax, the login form was loaded as part of a http page as opposed to https, which is not good, and then the login form data submitted by ajax to a https controller url. on success some javascript would try to load a https landing page into the main window.
The problem was magento would redirect the landing page which is what you're experiencing.
To solve hte issues, we loaded the login form by https and dynamically put it into the dom. We used the form action to a https link, and a form submit rather than an ajax post. Then the magento controller would use a redirect in the response to the landing page or an error page.
Go to Your system->confi->web->Session Validation Settings
Validate HTTP_X_FORWARDED_FOR and Validate HTTP_USER_AGENT
this two fields are enable so only disable it ! :)

Magento From local server to live web server, links not working

Now, the homepage is working fine but every link on it directs you to a 404 not found error. Can't even access "/admin".
Just add "index.php" next to the domain. For ex: If your website name is www.google.com then try to access this as www.google.com/index.php/electronics/cell-phones.html
This is due to the url rewrite in magento.
Permanent solution: Go to the admin and follow this:
System-> Configuration -> Web ->Search engine Optimization -> Url Web Server Rewrites. Make this to YES and SAVE the changes.
Now clear the cache and navigate to all the page in your website.

Custom 404 page in Magento

I know you can create and customize 404 pages directly within the Magento backend. However, I am wanting to completely use my own 404 customized page and was wondering how to do this.
I have created a 404.html file and added it in the root of my magento installation. However, I don't see in the .htaccess file how magento currently is redirecting the 404 to the CMS 404 page. How can I have it redirect to my custom 404 html file instead without causing some sort of never ending redirect loop?
Thanks!
404 page set from backend
System>Configuration>General>Web>Default Pages > YOU CAN FIND CMS No Route Page which will be default Magento CMS PAGE 404
for custom 404 page you have to create new cms page and you have to call your CUSTOM.phtml file in your new cms page after then go to the
System>Configuration>General>Web>Default Pages >CMS No Route Page > you can see your cms page and set your page as 404 page
I know it is quite an old question, but I've found the answer in this tutorial: http://alanstorm.com/magentos_many_404_pages
It explain very well how to make really custom 404 error page.

Resources