17

A link like <a href="www.example.software"> is defined by the HTML/HTTP spec as a relative link. If you are currently on https://www.example.software/ it would result in the URL https://www.example.software/www.example.software. If you are currently on https://www.example.software/foo/some-page.html it would result in the URL https://www....


4

The mod_alias Redirect directive uses prefix-matching and everything after the match is copied onto the end of the target URL. You can use RedirectMatch (which uses a regex as opposed to simple prefix-matching) to match a specific URL. However, since Magento already uses mod_rewrite directives (as part of the front-controller pattern) in .htaccess you should ...


4

You may want to read on Basic Authentication. From that article: Server side When the server wants the user agent to authenticate itself towards the server after receiving an unauthenticated request, it must send a response with a HTTP 401 Unauthorized status line[5] and a WWW-Authenticate header field.[6] The WWW-Authenticate header field for basic ...


3

In addition to Apache/mod_rewrite, some of this behaviour can be the result of the browser and how the OS maps the request to the filesystem. But as noted in comments, a "testing tool" can also result in (incorrect/unclear) behaviour that is unique to that tool. To clarify, this is .htaccess in the document root (a directory context). If these ...


3

Since version 2.4.16 RewriteBase directive is not required when the request is mapped via Alias. Basically it means that if you have multiple Alias DocumentRoot /var/www/html Alias /siteA /var/www/docroot Alias /siteB /var/www/docroot Before 2.4.16 you need to specify the RewriteBase with some gimmick in .htaccess or use the Symphony way as suggested by @...


3

It isn't the server that is remembering you, it is the client. When you log in with Basic Authentication or Digest Authentication, the browser remembers your login credentials and sends them with each and every request to the server. Browsers typically remember this information until the browser is restarted and give the web server no control. It is not ...


2

For your non-www you forgot RewriteCond %{HTTPS} =on So try: RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteCond %{HTTPS} =on RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]


2

In response to MrWhite's comment, I found out how to see the redirect chain in the browser mimiced what ahrefs was saying. When I took out the ruleset to remove the www, it works fine. #remove www from https #RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] #RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,QSA,NC,L] I would still like to remove www. Further ...


Only top voted, non community-wiki answers of a minimum length are eligible