Hello there,
New the the forums and hoping not only to get some help but to give some help as well. I could really use some input on my htaccess files. Yes, files. Currently running a website out of root while another website is being created in a subfolder. Once the new site is complete the htaccess file on root will point any calls to root to the subfolder thus making the subfolder the root of the server.
I am going to post a message I sent to another person I had the opportunity to talk to. Unfortunately he did not know the best way to go about this from what I have so far. No, I can't move the new website to the root and have just one htaccess file. Well, let me just post the message and hope for the best
______________________________________
I have a question for you. I need help with my htaccess file based on your stop image hotlinking article.
http://www.davidairey.com/stop-image...king-htaccess/
I am going to try and make this short. I have a working webpage at the moment on the root of my server.
http://www.fabian8.com
this is what is in the htaccess file now.
AddHandler application/x-httpd-php5 .php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
order allow,deny
deny from all
once I flip the switch to the new site which is located in the wordpress folder
http://www.fabian8.com/wordpress/
The root folder htaccess file will have this in it:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST}
fabian8.com$
RewriteCond %{REQUEST_URI} !wordpress/
RewriteRule ^(.*)$ wordpress/$1
and the one inside the wordpress folder will have this in it:
AddHandler application/x-httpd-php5 .php
# BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
# END WordPress
I want to add your code to the site. However, with my little bit of knowledge on htaccess file I am sure there is a better way of doing this. Is there any chance I can get you to provide me with a proper htaccess file based on the information above and the best way to do it.
____________________________________
Can someone please help me design a simple yet elegant htaccess file that incorporates the information above and this bit of code:
Here’s how to deter the thieves
You need to add some code into your .htaccess file, which should be in your website’s root directory.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^
http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png|jpg)$ /images/nohotlink.jpe [L]
In my case, I changed the
mysite text above to
davidairey, and you would add your own domain here.
Then I created a custom image titled nohotlink.jpe, and uploaded it to my /image/ folder. Notice the file extension .jpe – this is because .jpeg and .jpg files are now blocked from appearing on third party websites, but this exception allows you to show your custom image.
Information was copied from
http://www.davidairey.com/stop-image...king-htaccess/ for proper credit.
I want to thank anyone that can help or direct me properly on this. If any more information is required please don't hesitate to ask here, send me a pm or snap your fingers.
Thanks again for any help
Kind regards,
Saxamo