Menu

Topic-icon Adding www redirection to RewriteEngine On

  • Łukasz
  • Łukasz's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 3 weeks ago #6151 by Łukasz
Hello, I've noticed a problem with links on subpages that have redirected to www. It turned out that the entry is added

## Begin Securitycheck Pro Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
## End Securitycheck Pro Redirect non-www to www

can not be at the bottom of the hatccess just after RewriteEngine He in the top of the hatcess. In this case, redirects entered manually without www work correctly otherwise they are redirected to index.php. Please consider this change in the next issue. Is it possible to add an option in the panel so that the redirection would be on https?

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #6152 by Jose
Hi Łukasz,

The code is working fine in many other websites... You can move the entire code to the place you need it to suit your needs. Anyway I will check some ways to improve this feature.

Regards,
Jose

Please Log in or Create an account to join the conversation.

  • Łukasz
  • Łukasz's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 3 weeks ago #6153 by Łukasz
Replied by Łukasz on topic Adding www redirection to RewriteEngine On
I checked on 3 joomla 3.8.12 web hosts and each of them had the same problem. On the main page it works correctly but on the subpages how to remove http / https and www, each link goes to the main page of the domain with the index.php note.

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago - 2 months 3 weeks ago #6160 by Jose
Hi Łukasz,

Yes, you're right. This code must be placed just after the RewriteEngine On.

Please, do the following in any of your sites:
- Edit the .htaccess and delete the code added by SCP. Save the changes.
- Overwrite the file /administrator/components/com_securitycheckpro/models/protection.php with the attached file (unzip it before).
- Apply the .htaccess protection and tell me if it works.

The code should also redirect to https if the site uses the protocol.

Regards,
Jose
Last edit: 2 months 3 weeks ago by Jose. Reason: Fix a typo

Please Log in or Create an account to join the conversation.

  • Łukasz
  • Łukasz's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 3 weeks ago #6163 by Łukasz
Replied by Łukasz on topic Adding www redirection to RewriteEngine On
Did not work. I get an error when saving.
Wystąpił błąd.
0 Call to undefined function dump()

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #6164 by Jose
Upps, sorry. There was a test function. Try with this.

Regards,
Jose
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum

Login or Sign In