The “Too many redirects” error on WordPress is often related to issues with the site’s URL settings, conflicts with plugins, or server misconfigurations. Here are some steps you can take to fix this issue:
1. Check Site URL and Home URL
Ensure that your site URL and home URL are set correctly in WordPress. You can do this via the wp-config.php file or the WordPress dashboard.
- Via wp-config.php: Add these lines to your
wp-config.phpfile, replacingyourdomain.comwith the correct URL for your site:define('WP_HOME', 'https://mosque.learncodeweb.com'); define('WP_SITEURL', 'https://mosque.learncodeweb.com');This will force WordPress to use the correct URL. - Via Database (phpMyAdmin): You can also check and update the URLs directly in the database:
- Go to
phpMyAdmin(or your hosting database management tool). - Select your WordPress database.
- Look for the
wp_optionstable (or with a prefix if you use a custom one, likewp_). - Edit the
siteurlandhomefields tohttps://mosque.learncodeweb.com.
- Go to

2. Clear Browser Cache and Cookies
Sometimes, a cached version of the site can cause this issue. Clear your browser cache and cookies and then try accessing the site again.
3. Disable Plugins and Themes
- Via FTP: Sometimes plugins or themes cause conflicts leading to redirects. To rule this out:
- Connect to your site using FTP or cPanel’s file manager.
- Go to
wp-contentand rename thepluginsfolder (e.g., toplugins_old). - Try accessing the site again.
- If you can access the dashboard, a plugin is causing the issue. You can rename the folder back to
pluginsand disable plugins one by one to identify the culprit.
4. Check .htaccess File
The .htaccess file might have some incorrect redirect rules. To reset it:
- Connect to your site via FTP or file manager.
- Find the
.htaccessfile in the root of your WordPress installation. - Rename the
.htaccessfile to something like.htaccess_old. - Try accessing your site again. If it works, go to Settings > Permalinks in the WordPress dashboard and click “Save Changes” to regenerate a fresh
.htaccessfile.
5. SSL/HTTPS Conflicts
If you recently added SSL (HTTPS) to your site or moved from HTTP to HTTPS, make sure that the site’s settings reflect that correctly:
- Make sure both
WP_HOMEandWP_SITEURLare set tohttps://mosque.learncodeweb.com. - If your server is set to force HTTPS, it can create a redirect loop. You can also check your server’s SSL configuration or disable SSL redirection temporarily.
6. Check for Server-Side Issues
- If you have access to your server logs, check for any errors related to redirects or HTTP status codes. Your web hosting provider can also assist in identifying server-related issues.
After trying these steps, you should be able to resolve the “Too many redirects” issue. If you’re still facing problems, let me know!