How to Fix Common Magento Issues

While Magento may be a good and stable system, there are times when you might need to make a few tweaks and adjustments. Sometimes issues arise that need to be taken care of to keep the site working properly.

In this tutorial, I’m going to show you how to fix Magento issues that you may come across after building your website. Some of these are quite simple and don’t take a lot of programming knowledge to address.

Configuring a New Domain Name in Magento

What if you decide to change the domain name of your site to something more appropriate? In the past, many eCommerce owners decided to simplify the URL or make it more marketable for what they sell. In any case, you’ll need to configure Magento to work with the new name.

Changing the Domain in Magento

From Magento, select the Stores section and click “Configuration.”

Store Configuration

Click the “Web” tab on the left side of the screen.

Web Configuration

Click to expand the “Base URLs” options.

Magento Base URLs

Change the Base URL to reflect the new domain and click “Save Config.” For example, you would enter “https://www.ggexample.com.”

Magento Save Config

If you use an SSL to support secure access, do the same for Base URLs (Secure). It may not be a bad idea to do this even if you don’t have the SSL attached. It will save you a step later on should you choose to add it.

Magento URLs For SSL

Clearing the Cache

When you make any change to your website, it’s always best to clear the cache. This keeps the file system current and optimized for your visitors.

Go to the System section of Magento and click “Cache Management.”

Magento Cache Management Access

Click the “Flush Magento Cache” button on the top. After the site clears its data, your site is ready for visitors to the new domain name.

Flush Magento Cache Button

Resetting the Admin Password in Magento

Perhaps you forgot the administrative password to Magento. Maybe someone stole it, and you want to change the password before someone wreaks havoc on your site. For whatever reason, changing the admin password is relatively simple.

From cPanel, click the phpMyAdmin tool.

Magento phpMyAdmin

Find your database for Magento in the left column and click it.

Click Magento Database

Click the “SQL” tab along the top toolbar of phpMyAdmin.

SQL Tab phpMyAdmin

Paste the following code in the box for queries:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]UPDATE admin_user SET password=CONCAT(MD5(‘sGnewpass’), ‘:sG’) WHERE username=’AdminUsername’;[/ht_message]
You will have to change the newpass to the new password and AdminUsername to the admin username.

Once you’ve entered the query, click the “Go” button on the bottom right.

Magento Admin Password Query

If you have access to the admin panel of Magento, or if another user can access it, you can also change the password for the account in the System area under “All Users.”

User New Password

Setting Magento to Use Search Engine-Friendly URLs

Search engine-friendly URLs are those that improve how sites like Google crawl and categorize your content. It’s also beneficial for visitors if they see URLs that are easier to identify with the content.

In the configuration screen of the Stores section, click the “Web” tab.

Click Web Tab

Click the Search Engine Optimization function and select “Yes” from the rewrites option. This may already be set by default in Magento 2.0 and later.

SEO Rewrites Function

Click the “Save Config” button on the top right, and you’re done. You may have to flush your cache afterward to keep the site running smoothly.

Save SEO Config

Setting “WWW” URLs to Open Magento

Depending on how you have the domain set up through your Magento web hosting account, sometimes the “www” in a URL may not work. You may also want to set the prefix to open because of SEO or usability reasons. Regardless of the purpose, you can change how Magento opens the website when shoppers visit.

.htaccess Changes

Edit the “.htaccess” file of Magento from File Manager in cPanel.

Edit Magento HTaccess File

Input the following code at the top of .htaccess and save the file (replace “ggexample.com” with your domain).
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]RewriteCond %{HTTP_HOST} ^ggexample.com$ [NC]
RewriteRule ^(.*)$ https://www.ggexample.com/$1 [R=301,L][/ht_message]

Edit HTaccess File

Magento Changes

Once the changes in .htaccess are saved, you’ll need to change the Base URL in Magento.

Go the Stores section and click “Configuration.” In the Web tab, you’ll find the Base URLs option. In the Base URL text box, input your website with the WWW prefix. For instance, you may enter https://www.ggexample.com. Save the configuration once you are done.

Do this to the secured URLs as well if you use SSL.

Magento Change URL Prefix

Solving Access Denied in Magento

If some areas of the site give you an error stating access is denied, the permissions may be altered for the account. To fix this, you’ll need to change the permission for the particular role.

The first thing you should try is to log out of Magento and then try to log back in again. It probably wouldn’t hurt to clear the cache of your web browser before attempting to log in. This will eliminate cached file problems as a factor.

Otherwise, go to the System section of Magento and click “All Users.”

Magento All Users

Click on the account in question to open its settings.

Magento Users

Click the “User Role” tab on the left.

Verify the account is set to Administrators. Otherwise, change it and click “Save User.”

Save Admin User

You can also verify permissions set by accessing “User Roles” from the System area. From here, you can create custom rules and create specific roles for you and your team.

Check User Roles

One thing you want to check is the “Resource Access” option. For administrators, this should always be set to “All.”

Magento User Resource Access

These are only a few problems that you may face while maintaining the website. To fix Magento issues keeps your eCommerce location running at optimal performance. When you first build an online store, you may not realize the amount of effort you need to put in to keep it running smoothly. Remember, effort plays heavily in success.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.