Thursday 4 October 2012

To secure specific urls of a website

Sometimes we need some urls https and others http, This can also done bye htaccess easily.


### AR SSL ######
RewriteEngine on 
Options +FollowSymlinks 
RewriteCond %{SERVER_PORT} ^443$ 
RewriteRule ^robots.txt$ robots_ssl.txt

In robot.txt i have given the some specific folder path or some file type which can be allow or disallow to a visitor

robot.txt:

# allow all
User-agent: *

Disallow: /backup/
Disallow: /site/
Disallow: /*.php
Disallow: /*% 
Disallow: /*? 
 
robot_ssl.txt
# SSL robots

User-agent: *
Disallow: / 

#User-agent: *
Allow: /signup/
Allow: /register/
Allow: /user/forgotpass/
 
So signup, forgot password and login page would be https and others would be http.
 
please give feedback if you want to.

No comments:

Post a Comment