Tags » Htaccess

如何使用.htaccess文件強制HTTPS

有時需要確保您網站的訪問者使用SSL加密連接。如果你不熟悉SSL,想了解更多,請閱讀我們的文章“ 什麼是SSL,為什麼它很重要?“

強制訪問者使用SSL可以通過使用mod_rewrite的.htaccess文件完成。

重要:如果您的.htacess中已經有重複的程式碼,請在您的.htacess中已經有類似的規則的情況下添加以下程式碼:

RewriteEngine On

RewriteCond %SERVER_PORT 80

RewriteRule ^(.*)$ https://www.example.com/$1

請務必使用您的實際域名替換www.example.com。

要強制特定網域使用HTTPS,請在網站根文件夾中的.htaccess文件中使用以下程式碼:

RewriteEngine On

RewriteCond %HTTP_HOST ^example\.com

RewriteCond %SERVER_PORT 80

RewriteRule ^(.*)$ https://www.example.com/$1…

61 more words

How to enable mod rewrite for Apache?

### Enable the mod rewrite
$ sudo a2enmod rewrite

### Update the website configuration
$ sudo vi /etc/apache2/sites-enabled/ciblog.local.conf 
ServerAdmin webmaster@localhost
        DocumentRoot /var/www/_php/sample-blog
        ServerName ciblog.local:8081
        ServerAlias ciblog.local
    {Directory}
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      Allow from all
    {/Directory}

$ sudo /etc/init.d/apache2 restart

### Then create .htaccess file in the root of your codeigniter app
  SetEnv CI_ENV development
  RewriteEngine On
  # !IMPORTANT! 90 more words

Anti-piracy software developer leaves website open to snoops

Sharing is caring, perhaps – but when it comes to your website’s files and directories, it’s not a good idea, as Denuvo found out this week. 559 more words

Vulnerability

how to restrict directory access using htaccess and allow only my ip

Restrict directory access using htaccess and allow only my ip

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} /your directory name
RewriteCond %{REMOTE_ADDR} !=111.111.111.111
RewriteRule ^.*$ /maintenance.php 
Htaccess

Remove index.php file in codeigniter OR wordpress on windows server

Remove index.php file in Codeigniter or wordpress or other freamwork  on Windows IIS7 Server

Sometime .htaccess file does not work on windows server, so we have use web.config file insted of .htaccess in root path… 81 more words

Php

Recover a hacked website

So, one of the sites i know got infected with malware, not a proud thing to say but sh*t happens, given that i had just updated wordpress and all the plugins that could safely be updated while maintaining full site functionality (in this case all the plugins that had the update option were updated) i was puzzled how this had happened. 1,420 more words

Geek Stuff