Differences

This shows you the differences between two versions of the page.

Link to this comparison view

user_documentation:use:features:new:htaccess_and_hotlink_in_2.4 [2012/05/18 12:51]
mistic100 created (not finished)
user_documentation:use:features:new:htaccess_and_hotlink_in_2.4 [2013/03/07 14:03] (current)
Line 1: Line 1:
 +======Hotlinks and HTACCESS in Piwigo 2.4======
 +
 +====Presentation====
 Piwigo 2.4 introduces the feature multizise, this includes many technical changes, especially in the filesystem : Piwigo 2.4 introduces the feature multizise, this includes many technical changes, especially in the filesystem :
  
-Before 2.4 teh filesystem looked like this :+Before 2.4 the galleries and upload folders looked like this :
 <file> <file>
 +--Album +--Album
Line 17: Line 20:
 </file> </file>
  
-Now in 2.4 we keep only one version of each photo (the original file) :+Now in 2.4 we keep only one version of each photo (the original file, equivalent to old //pwg_high//) :
 <file> <file>
 +--Album +--Album
Line 33: Line 36:
 contains some url rewrite rules informing your host that links to pictures had changed. contains some url rewrite rules informing your host that links to pictures had changed.
  
 +====Upgrade procedure====
 If for some reason Piwigo can't create or modify the file you will have to edit it manually. Before do that think if you need it : if you are sure nobody hotlinks your pictures you can just ignore the following steps. If for some reason Piwigo can't create or modify the file you will have to edit it manually. Before do that think if you need it : if you are sure nobody hotlinks your pictures you can just ignore the following steps.
  
-Default .htaccess : +  - First of all, navigate to your Piwigo installation folder with a FTP client 
-<file>+  - If you don't see a file named **.htaccess** (with the first dot) create it 
 +  - Now open this file with a text editor like Notepad (not complex a editor like Microsoft Word) 
 +  - If it's a previously existing file, be careful there is not **RewriteEngine off** into it, otherwise you have to modify it into **RewriteEngine on** or the following will break your website. 
 +  - Add it the **.htaccess** file these lines with some modifications 
 +    * on lines 5 and 6 modify **thumbnail** by the content of your local **$conf['dir_thumbnail']** if you have one 
 +    * on lines 5 and 6 modify **TN\-** by the content of your local **$conf['prefix_thumbnail']** if you have one 
 +    * <wrap hi>on lines 13 and 15 modify **localhost** by your hostname without //http// or //www//</wrap> (example: **my\-website\.com**) 
 +    * CAUTION: if you have hyphens in all these values prepend them with a anti-slash (**TN-** becomes **TN\-**), you must also escape dots 
 +    <file
 +<IfModule mod_rewrite.c>
 RewriteEngine on RewriteEngine on
  
Line 52: Line 65:
 RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/.*$ [NC]
 RewriteRule ^galleries(.*)/(.*)\.([a-z0-9]{3,4})$ i.php?/galleries/$1/$2-me.$3 [L] RewriteRule ^galleries(.*)/(.*)\.([a-z0-9]{3,4})$ i.php?/galleries/$1/$2-me.$3 [L]
 +</IfModule>
 </file> </file>
- +  - Now old hotlinks should we correctly redirected
-TODO : explanations+
 
Back to top
user_documentation/use/features/new/htaccess_and_hotlink_in_2.4.1337345487.txt.gz · Last modified: 2012/05/18 12:51 by mistic100
 
 
github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact