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
remove www in htaccess for directory
102 Views Asked by Mpzed At
2
There are 2 best solutions below
0
Mpzed
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://
Related Questions in .HTACCESS
- Special access rule in an .htaccess file for IP addresses, authorized only for one directory structure
- Check REQUEST_URI for any /nl/ or /en/ to change my RewriteRules
- How to ignore case in regexp mapping in a .htaccess rewrite rule?
- Use htaccess to add subdirectory to url while displaying base url
- Making a POST to a folder are recived as a GET
- Missing Headers Security Report .htaccess
- I can't retrieve GET values
- Ionic local CORS error, yet headers are set
- htaccess rewrite rule - if the parameter value has forward slashes
- How to configure .htaccess file for two different websites routing in my shared hosting server
- Blank page after Create React App Build placed on server
- How to redirect to the landing page when the domain name is searched?
- problem with htaccess RewriteRule with parameters
- WordPress Multisite Subdomain showing error 404
- htaccess config to serve jxl / avif if file exist
Related Questions in REDIRECT
- How to redirect to thank you page after submitting a Google form embedded into a Google Site?
- Redirect Users to another website using GAS
- Hyperlink doesn't redirect while others do
- 301 Redirect to assimilate one website into another
- How to make common post or page for external links in wordpress website using php or any language
- What is the best strategy to correct a referenced subdomain development website damaging my production seo
- DocuSign integrated login fails when MFA is enabled
- Domain Still Redirecting Despite Transferring Out of Godaddy
- How I can prevent the redirections in API using middleware on Laravel 11?
- How redirect to current page after login (Flask)
- Redirect to another site but show the original URL in browser
- How to redirect to another page eg main.py after user fill in and click register button and store it on .ini local database on python using kivy
- Error 302: ERR_TOO_MANY_REDIRECTS in Prestashop Back Office
- Next.js Middleware for Session Authentication Redirects: Errors Encountered
- Sharepoint document library URL Rewrite
Related Questions in NO-WWW
- Non-www to www in Laravel php script Not Redirect Problem
- Redirect all www URL to non www and make laravel-project/public 404 not found
- WordPress Multisite subpages of Main Site redirect to Front Page when accessed with non www
- Redirecting non-WWW to www
- .htaccess redirect www to non-www but not doing anything
- Redirect www to non-www on Azure Dns Zone
- Redirection "www" to "http://" of a Wordpress site by .htaccess file
- htaccess file - root and website folder htaccess file both have different code. URL does not work without the www
- 404 not found when not typing www
- HTACCESS 301 redirect to solve redirect error in google search console?
- apache2 www to non-www redirection not working
- Angular app cannot be accessed on webserver without prefix "www"
- .htaccess in subdirectory | Redirect to www from non-www
- In .Net Core 5, How to redirect www to non-www URL?
- How to resolve www issue in base url from ngnix.conf file
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
if I've understood your question (and please make it more clear this time and next times :) ) you can do it like this :
Or
have a nice iranian day !