Scribbles about htaccess fun

Image frame
Htaccess- 301 Redirect An Entire Directory / Folder

Htaccess- 301 Redirect An Entire Directory / Folder

Here’s a simple pierce of code which will permanently redirect a folder / directory. For example, if you have a directory in the following path: http://www.example.com/pictures/, and for whatever reason decide to rename the directory to http://www.example.com/new-pictures/, the following htaccess code will safely redirect all users from /pictures/ to /new-pictures/
Redirect An Entire Directory / Folder [...]



Maruf scribbled this post.
1
htaccess fun
Sep 19th, 2009
Image frame
Htaccess: Prevent People Hotlinking Your Images

Htaccess: Prevent People Hotlinking Your Images

Here’s some Htaccess code that will prevent people from hotlinking images hosted on your server. Simply change the domain to yours and then apply the code to your .htaccess. It’s as easy as that.

View Code PHP1
2
3
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?brightcherry.co.uk [NC]
RewriteRule \.(jpeg|jpg|gif|png)$ – [F]

The code is basically saying that all jpg, [...]



Maruf scribbled this post.
1
htaccess fun
Aug 22nd, 2009
want a website, do ya?

latest projects

Image frame
RG Active
view site- RG Active
Image frame
Property Investment Project
view site- Property Investment Project

latest scribbles

latest comments

zurin Gravatar frame
zurin said
hi, i’m having problem with this function. it works fine...
Karlos Gravatar frame
Karlos said
Awesome awesome awesome :) Just started re-designing...
satheesh Gravatar frame
satheesh said
It solved my problem. Thank you. Is it possible to get the...

blog categories

Get a free quote