Unable to remove the www from url on https using .htaccess -
i want remove www site url.
ie. https://www.domainname.com.au https://domainname.com.au.
i have tried various .htacces code nothing work me.
here present code remove www http not work https.
rewriteengine on rewritebase / rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^/(.*)$ http://%1/$1 [r=301,l] rewritecond %{https} off rewriterule ^(.*)$ https://domainname.com.au/$1 [r=301,l] rewriterule ^code-of-conducts/(.*)/$ code-of-conducts.php?type=$1 rewriterule ^parents/post-a-job/(.*)/edit/$ parents/post-a-job.php?action=edit&id=$1 rewriterule ^parents/post-a-job/(.*)/$ parents/post-a-job.php?job_type=$1 rewriterule ^parents/open-jobs/(.*)/delete/$ parents/open-jobs.php?action=delete&id=$1 rewriterule ^parent-profile/(.*)/$ parent-profile.php?id=$1 rewriterule ^parents/job-details/(.*)$ parents/job-details.php?applied_id=$1 rewriterule ^sitterprofile/(.*)/$ sitterprofile.php?id=$1 rewriterule ^sitter/job-board/state/(.*)/page/(.*)/$ sitter/job-board.php?state=$1&in_page=$2 rewriterule ^sitter/job-board/state/(.*)/$ sitter/job-board.php?state=$1 rewriterule ^sitter/job-details/(.*)$ sitter/job-details.php?applied_id=$1 rewriterule ^(.*)/$ $1.php rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri} rewritecond %{http_host} ^www\.(.+)$ [nc] rewritecond %{https}s ^on(s)| rewriterule ^ http%2://%1%{request_uri} [l,r=301]
any in regard highly appreciated.
rewritecond %{https_host} ^www\.(.*)$ [nc] rewriterule ^/(.*)$ https://%1/$1 [r=301,l]
try adding also.
Comments
Post a Comment