We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

question about htacces file and email template | Forum

Topic location: Forum home » Support » General Questions
Jordi
Jordi Jan 25 '15
Hi i dont know anything about the htaccess file's

I did a search and found some solutions but i cant get them to work so plz help me with this.


I want to add a folder ( image ) to root of my server (public) in this folder i want to put some images for my email template. 

i added some rules to the htaccess file for block hotlinking but now i cant get my images to work in my email template. 


here is a copy from my htaccess file. 


Thanks!!!


Options +FollowSymLinks

RewriteEngine On


AddEncoding gzip .gz

AddEncoding gzip .gzip

<FilesMatch "\.(js.gz|js.gzip)$">

  ForceType text/javascript

</FilesMatch>

<FilesMatch "\.(css.gz|css.gzip)$">

  ForceType text/css

</FilesMatch>


AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript


RewriteCond %{REQUEST_URI} !/sitemap.xml

RewriteCond %{REQUEST_URI} !/robots.txt


RewriteCond %{REQUEST_URI} !^/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/

RewriteCond %{REQUEST_URI} !/ow_cron/run\.php

RewriteCond %{REQUEST_URI} !/e500\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteRule (.*) index.php


#block images by direct url all sites listed are authorized

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^https://(www.)?theotherbook.com/      [NC]

RewriteRule .*\.(jpg|jpeg|gif|png|bmp|wmv)$ - [F,NC,L]

The Forum post is edited by Jordi Jan 25 '15
ross Team
ross Jan 25 '15
Why do you upload them directly to the server. You can put your graphics here: www.site.com/admin/theme/graphics and later use it. 
Jordi
Jordi Jan 25 '15
Ross,


because those images are also blocked by the htaccess file. 

I need to use the images from outside the site.



ross Team
ross Jan 26 '15
What do you mean they are also blocked?
I just tried that on my test website. Everything works ok. 

See screenshots:



this the e-mail I get


the image is one of which I uploaded to the graphics section. 


The Forum post is edited by ross Jan 26 '15
Jordi
Jordi Jan 26 '15
Ross,


I use a html email template the takes his photo's from outside the massmail email program .

I use the email template for the sign up mail etc. 


So I need a folder that readable from outside the domain.

ross Team
ross Jan 26 '15
I don't understand what you're doing and trying to achieve, but to make a folder accessible check this post: http://www.oxwall.org/forum/topic/3913?page=1#post-17955
Jordi
Jordi Jan 26 '15
Ross, i doesnt work. I put the line from the toppic in my htacces file. And removed the hotlinking part. But is till dont work to get into the images folder.


Options +FollowSymLinks

RewriteEngine On


AddEncoding gzip .gz

AddEncoding gzip .gzip

<FilesMatch "\.(js.gz|js.gzip)$">

  ForceType text/javascript

</FilesMatch>

<FilesMatch "\.(css.gz|css.gzip)$">

  ForceType text/css

</FilesMatch>



AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript


RewriteCond %{REQUEST_URI} !/sitemap.xml

RewriteCond %{REQUEST_URI} !/robots.txt

RewriteCond %{REQUEST_URI} !/images/


RewriteCond %{REQUEST_URI} !^/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/

RewriteCond %{REQUEST_URI} !/ow_cron/run\.php

RewriteCond %{REQUEST_URI} !/e500\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteRule (.*) index.php


The Forum post is edited by Jordi Jan 26 '15
Jordi
Jordi Jan 26 '15
even when i remove the htacces file i don't have permission...
ross Team
ross Jan 26 '15
Jordi, I use default htaccess and everything works fine. This is what I get