![]() |
|
problem with mod_rewrite and nice URLs - 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: problem with mod_rewrite and nice URLs (/thread-1939.html) |
problem with mod_rewrite and nice URLs - dcruzin - 2007-12-15 Hi, I'm trying to get nice cruft-free URLs for my gallery (http://dcruzinphotography.com/gallery) which is running version 1.1.2, and I've read the documentation like 3 times and searched these forums multiple times, but nothing I've done seems to work. I called GoDaddy and they assured me that I have mod_rewrite. I edited my RewriteBase to be /gallery (see below for full .htaccess file). I tried changing the permissions on the .htaccess file to chmod 666. Every time I change the option to enable mod_rewrite within options, I get a 404 error. Also, when I do that, it seems to want to go the wrong path. I have an album named Landscapes thats at dcruzinphotography.com/gallery/albums/Landscapes, but when I try to enable mod_rewrite and get the 404 error, its trying to go to dcruzinphotography.com/gallery/Landscapes (without /albums/). Is that normal? Even if i manually insert /albums/ in the URL, I still get a 404. Not sure what else to try. Anyone have ideas? here's my current .htaccess: htaccess file for zenphoto # NOTE: Change the RewriteBase below to the absolute path to your zenphoto directory. RewriteEngine On #### !!! Change this to the web path (eg: http://www.yourwebsite.com/photos --> /photos) !!! RewriteBase /gallery #### RewriteRule ^admin/?$ zp-core/admin.php [R,L] RewriteRule ^search/?$ index.php?p=search [R,L] RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUESTFILENAME} -d [NC] RewriteRule ^.*$ - [R,L] RewriteRule index.php$ index.php [L,QSA] RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA] RewriteRule ^page/([A-Za-z0-9-]+)/?$ index.php?p=$1 [L,QSA] RewriteRule ^(.)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA] #### !!! If you install the zen core in a folder other than 'zp-core' you must change the following lines RewriteRule ^(.)/image/(thumb|[0-9]{1,4})/([^/\]+)$ zp-core/i.php?a=$1&i=$3&s=$2 [L,QSA] RewriteRule ^(.)/image/([^/\]+)$ zp-core/i.php?a=$1&i=$2 [L,QSA] #### # Catch-all - everything else gets handled in PHP for compatibility. RewriteRule ^(.)/?$ index.php?album=$1 [L,QSA]problem with mod_rewrite and nice URLs - sbillard - 2007-12-15 If you will download the nightly build (http://www.zenphoto.org/files/nightly/) upload it and run the setup program. It will check your system configuration for errors. problem with mod_rewrite and nice URLs - dcruzin - 2007-12-16 I finally figured it out. I'm using both Wordpress and ZenPhoto together, so I had 2 .htaccess files, and I had to learn about how .htaccess files work and that they're inheirited from parent directories if the current directory doesn't have one. So I just made sure I had one .htaccess file which is in the root directory of http://dcruzinphotography.com and that it had RewriteBase /gallery, since the zenphoto installation is in that directory. Before, Wordpress had auto generated some .htaccess files that were messing it up, but I deleted it and started clean and it worked |