![]() |
|
zenphoto-rewrite.txt to redirect pages. - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: zenphoto-rewrite.txt to redirect pages. (/thread-13417.html) |
zenphoto-rewrite.txt to redirect pages. - ctdlg - 2020-06-07 Hello, I want to redirect a domain to another one. The following code at the beginning of zenphoto-rewrite.txt does not work RewriteCond %{HTTP_HOST} ^dominotes.fr$ I get I have also tried Adding the correct code at the beginning of .htaccess does nothing as if it's overridden by zenphoto-rewrite.txt I have not found any htaccess to txt file converter ! zenphoto-rewrite.txt to redirect pages. - sbillard - 2020-06-07 First, if your code does not work in the root .htaccess file then there is something wrong with it or your site's rewrite handling. .htaccess rules are processed before any zenphoto code gets executed. Second, the intent of the internal rewrite handling is to service zenphoto SEO and aliasing. So, for instance, there is no code to process the RewriteCond directive since there (at present) is no need for the construct. The reason for handling the rules internally is twofold. First to make the .htaccess file (or equivalent for non-apache servers) as simple and constant as possible. Second it to allow the rules to be dynamic so that plugins, etc. can mold them to their needs. What you seem to want to do--redirect from an old site domain to a new site domain--is properly the job of the server rewrite handler. zenphoto-rewrite.txt to redirect pages. - ctdlg - 2020-06-08 Thank you sbillard... The code was ok , BUT This message might help some other zenphoto user ! zenphoto-rewrite.txt to redirect pages. - acrylian - 2020-06-08
If both domains are on your same server, you should also look at your webhost's panel for your webspace as it probably features some setting for this already. Then you don't need to use htaccess at all. zenphoto-rewrite.txt to redirect pages. - ctdlg - 2020-06-08 @acrylian : I moved the code inside zenphoto's .htaccess file with my webhost's panel editor. This means my webpanel manages the redirecting code ! Strange, because if I write with a french pen or a german pen, I will read the same words, not 2 different texts ! Thank you for your help. Note : I moved from php 7.2 to php 7.4, with zenphoto 1.5.7, and everything is faster. (7.4 is faster than 7.2) zenphoto-rewrite.txt to redirect pages. - acrylian - 2020-06-08 Yes, such redirection code belongs to the beginning before everythging else follows. However I was not referring to any htaccess editor via your host but some domain management tool to provide some means to define where a domain on your server is linked to. Be it a folder on the webspace or another domain or subdomain. Not all hosts are the same and some might not have that although all I know do. This is usually not done via htaccess directly to see via FTP but "behind the scenes" in some internal server configuration (perhaps it is htaccess on some root level as well, I don't really know). And yes, php 7 in general is much faster than 5 ever was. Thanks. |