remove www in htaccess for directory

69 Views Asked by At

I have a website that I have created on one of its folders. Now I want to delete the site with the command. My page is located here

2

There are 2 best solutions below

0
On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://example.ir%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS}s ^on(s)|
RewriteCond http%1://%{HTTP_HOST}%{REQUEST_URI} ^(https?://)www\.(.+) [NC]
RewriteRule ^ %1%2 [L,R,QSA]

first code : delete http and set to https and next code : delete https://www and set to https://

4
On

if I've understood your question (and please make it more clear this time and next times :) ) you can do it like this :

sudo rm .htaccess

Or

rm -rf Name-of-your-file

have a nice iranian day !