Redirect none www to www

Keywords: WordPress - AWS - How to - Application configuration

Description:
I want to redirect all none www URLs to www
I tried with bitnami guides…

Hi @Imajaychudasama,

this guide will help you redirect all the requests to www.YOURDOMAIN, did you follow it?

https://docs.bitnami.com/aws/apps/wordpress/administration/use-single-domain/

Happy to help!


Was my answer helpful? Click on :heart:

Yes i tried but it doesn’t work for me.
How can i redirect through.htaccess file

htaccess files are disabled by default due to security and performance reasons. You need to use the Apache’s conf files to perform that redirection. Can you run the Bitnami Diagnostic tool so we review your configuration?

Please note that you need to paste the code ID that is shown at the end.

856b8b61-c405-9776-9414-13160a651772

Please check all errors

https://example.com is redirecting to https://www.example.com but https://example.com/post-affiliate-marketing is not redirecting to https://www.example.com/post-affiliate-marketing

Hi @Imajaychudasama,

You have a WordPress with NGINX solution and that’s why the Apache’s documentation didn’t work for you. Please take a look at the NGINX’s one to perform the redirection

https://docs.bitnami.com/aws/apps/wordpress-pro/administration/use-single-domain-nginx/

I tried but didn’t work for me

Hi @Imajaychudasama,

Can you run the Bitnami Diagnostic Tool again so we can take a look at the configuration files again?

Thanks

1790fb0f-1661-a67b-c695-6fe0649e2fed

I have migrated my site to apache
Aws lightsail
Please check all errors…

Hi @Imajaychudasama,

I can see many different errors in the Apache’s log file and some of them are related to Cloudflare

[Mon Oct 04 18:42:18.383135 2021] [proxy_fcgi:error] [pid 7109:tid 139778527667968] [client 54.254.146.30:23432] AH01071: Got error 'PHP message: [Cloudflare] ERROR: [CLIENT API] Array\n(\n    [type] => request\n    [path] => https://api.cloudflare.com/client/v4/zones/?name=commonaffiliate.com\n    [timeout] => 30\n    [method] => GET\n    [headers] => Array\n        (\n            [Content-Type] => application/json\n            [X-Auth-Email] => REDACTED\n            [X-Auth-Key] => REDACTED\n        )\n\n)\n PHP message: [Cloudflare] ERROR: [CLIENT API] Array\n(\n    [type] => response\n    [reason] => Forbidden\n    [code] => 403\n)\n PHP message: [Cloudflare] ERROR: Forbidden ', referer: https://commonaffiliate.com/category/setup-a-website/
[Mon Oct 04 23:35:13.851092 2021] [autoindex:error] [pid 30061:tid 139778796234496] [client 18.193.76.129:31564] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Tue Oct 05 06:45:19.648659 2021] [autoindex:error] [pid 7306:tid 139778695522048] [client 18.185.5.191:59378] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com
[Tue Oct 05 14:10:04.294197 2021] [autoindex:error] [pid 5476:tid 139778880161536] [client 18.196.142.181:39860] AH01276: Cannot serve directory /opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: binance.com

Do you have any plugin related to that service?

Yes i use cloudflare and ezoic

Hi @Imajaychudasama,

Please review the configuration of those services. Note that we do not control them and they might be interfering. You can try to disable them and confirm if the redirection works properly in your site. Then, you can enable them again after checking everything works as expected.