Jump to content

[SOLVED] .htaccess guide needed


anupamsaha

Recommended Posts

Hello friends,

 

I have a following (sample) .htaccess placed in the web-server's root folder. Under the web-server's root folder, there exists a folder 'phpMyAdmin' and I don't want to include it in the URL redirection and also wants to access the same (phpMyAdmin and sub-folders and files in it) under 'https'. Can anybody please help me out to resolve this?

 

Thanks!

 

##### Turned off Apache's server signature ##################
ServerSignature Off

##### Error Documents #######################################
ErrorDocument 404 /error_document/404.html

##### Blocking based on User-Agent Header ###################
SetEnvIfNoCase ^User-Agent$ .*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures) HTTP_SAFE_BADBOT
SetEnvIfNoCase ^User-Agent$ .*(libwww-perl|aesop_com_spiderman) HTTP_SAFE_BADBOT
Deny from env=HTTP_SAFE_BADBOT 

##### Block Directory Listing ###############################
Options -Indexes +FollowSymLinks 

##### Set Index page to index.php ###########################
DirectoryIndex index.html index.htm index.php

RewriteEngine on 
RewriteBase /

##### XSS Protection ########################################
RewriteCond %{QUERY_STRING} (\<|%3C).*(script|object|applet|activex|vbscript|embed|xml|blink|cookie|meta|frame|frameset|iframe|style|link|param|onload|onclick|onfocus|onblur|onunload|onbeforeunload|onkeydown|onkeypress|onkeyup|onsubmit|onactivate|onabort).*(\>|%3E) [NC]
RewriteRule ^.* - [F,L]

RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

##### Rewite to / dynamically ###############################
#RewriteCond %{THE_REQUEST} ^.*/index\.(php|html|htm|pl|cgi|do|jsp|asp|aspx|shtm|shtml)
#RewriteRule ^(.*)index.(php|html|htm|pl|cgi|do|jsp|asp|aspx|shtm|shtml)$ $1 [R=301,L]

#RewriteCond %{THE_REQUEST} ^.*/(D|d)efault\.(html|htm|do)
#RewriteRule ^(.*)(D|d)efault.(html|htm|do)$ $1 [R=301,L]

#Blocking with RewriteCond
RewriteCond %{HTTP_USER_AGENT} ^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).*$ [NC]

RewriteRule . - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?module=$1 [L,QSA]

##### Deny access to htaccess ###############################
<files .htaccess>
order allow,deny
deny from all
</files>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.