Pages (2): 1 2   
Member
Member
easynow   09-01-2012, 22:07
#1

Hi. This is a great system you have provided. Thanks!

I have a problem getting mod_rewrite to work:
Whenever I check the box in admin to enable it, and save changes, I get a 404 and the changes arent saved.

I have made sure that my .htaccess points to the zenphoto root, and my server support people tell me mod_rewrite is definitely enabled..

I also noticed I happen to have a .htaccess in both the web root on my server space and the root of zenphoto itself.. Is this right?

I have exhausted the forum to try and find an answer for my specific problem, but no luck!

thanks for any help at all!

`

htaccess file version 1.2.8.0;


When Zenphoto requires changes to the rewrite rules:


First make a copy of this file as 'oldhtaccess' in the zp-core folder so setup can test for unmodified files


Update the above and the define in setup.php


RewriteEngine On

RewriteBase /zenphoto

RewriteRule ^admin/?$ zp-core/admin.php [R,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [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/([A-Za-z0-9
-]+)/([0-9]+)/?$ index.php?p=$1&page=$2 [L,QSA]
RewriteRule ^(.)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
RewriteRule ^(.
)/page/([A-Za-z0-9_-]+)/?$ index.php?album=$1&p=$2 [L,QSA]

Rewrite rule addition for search


RewriteRule ^page/search/fields([0-9]+)/(.)/([0-9]+)/?$ index.php?p=search&searchfields=$1&words=$2&page=$3 [L,QSA]
RewriteRule ^page/search/fields([0-9]+)/(.
)/?$ index.php?p=search&searchfields=$1&words=$2 [L,QSA]
RewriteRule ^page/search/archive/(.)/([0-9]+)/?$ index.php?p=search&date=$1&page=$2 [L,QSA]
RewriteRule ^page/search/archive/(.
)/?$ index.php?p=search&date=$1 [L,QSA]
RewriteRule ^page/search/tags/(.)/([0-9]+)/?$ index.php?p=search&searchfields=tags&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/tags/(.
)/?$ index.php?p=search&searchfields=tags&words=$1 [L,QSA]
RewriteRule ^page/search/(.)/([0-9]+)/?$ index.php?p=search&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/(.
)/?$ index.php?p=search&words=$1 [L,QSA]

Rewrite additions for zenpage


RewriteRule ^pages/?$      index.php?p=pages [L,QSA]

RewriteRule ^pages/(.)/?$ index.php?p=pages&title=$1 [L,QSA]
RewriteRule ^news/?$ index.php?p=news [L,QSA]
RewriteRule ^news/([0-9]+)/?$ index.php?p=news&page=$1 [L,QSA]
RewriteRule ^news/category/(.
)/([0-9]+)/?$ index.php?p=news&category=$1&page=$2 [L,QSA]
RewriteRule ^news/category/(.)/?$ index.php?p=news&category=$1 [L,QSA]
RewriteRule ^news/archive/(.
)/([0-9]+)/?$ index.php?p=news&date=$1&page=$2 [L,QSA]
RewriteRule ^news/archive/(.)/?$ index.php?p=news&date=$1 [L,QSA]
RewriteRule ^news/(.
)/?$ index.php?p=news&title=$1 [L,QSA]

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]
RewriteRule ^(.*)/album/(thumb|[0-9]{1,4})/([^/\]+)$ zp-core/i.php?a=$1&i=$3&s=$2&album=true [L,QSA]


Catch-all - everything else gets handled in PHP for compatibility.


RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]

`

Member
Member
Laurent   09-01-2012, 23:05
#2

Hi,
On some server you have to put this code
Options +FollowSymlinks before RewriteEngine On

Maybe is the solution.

Laurent

Member
Member
easynow   09-01-2012, 23:15
#3

now i get:


An appropriate representation of the requested resource /zp-core/admin-options.php could not be found on this server.


/


Member
Member
easynow   10-01-2012, 20:04
#4

hmmm

Member
Member
sbillard   10-01-2012, 21:14
#5

Quote:I also noticed I happen to have a .htaccess in both the web root on my server space and the root of zenphoto itself.. Is this right?
Zenphoto places the .htaccess in the root of the zenphoto install. Any .htaccess superior to that is from some place else. It is certainly possible for such a .htaccess to interfer with Zenphoto's rules.

Member
Member
easynow   10-01-2012, 22:05
#6

Ok! I shall delete the other one, thanks!

Also, i noted on a recent update, in the setup process, zenphoto confirmed various things about mod_rewrite on my server to be a.ok?

Member
Member
easynow   10-01-2012, 22:10
#7

same issue

Member
Member
sbillard   11-01-2012, 00:30
#8

Do you get the 404 error when saving the mod_rewrite option? Of on a different page?

In addition, what version of Zenphoto are you running? From the .htaccess file you listed it is an old one that should have been updated to prevent the recent security breach.

Note also that the security breach did cause problems with redirections. Have you "cleansed" your site?

Member
Member
easynow   11-01-2012, 01:21
#9

Well, I was on 1.2.8 at the beginning of the week, and have been trying to go through each subsequent update one by one, but my server has a habit of cutting me off halfway through uploads, which has put me off upgrading unless absolutely necessary for a little while..

I'm on 1.3 now.

I get a 404 when saving the option. When i return to the relevant page afterwards the box is still unchecked..

Member
Member
sbillard   11-01-2012, 01:51
#10

You should be able to go directly to 1.4.1.6 [or better still, 1.4. RC3] straight from there.

The admin pages are not using mod_rewrite, so that is not the issue then. Maybe a file permissions issue, but that seems unlikely since you can visit the page before the save.

What is showing in the browser's address bar when you get the 404 error?

Member
Member
easynow   11-01-2012, 02:26
#11

Ok, well when my host gets back to me on the upload errors i will upgrade. Thank you for the advice!

The URL i get is:
mydomain.com/zp-core/admin-options.php?action=saveoptions

Member
Member
easynow   11-01-2012, 02:34
#12

oh and i have done no 'cleansing'..?

Member
Member
sbillard   11-01-2012, 02:43
#13

If your site was hit by the hack, one of the things it did was spray .htaccess files all about. So one of those might be still around.

The link you show is pretty straight forward. So long as the admin-options.php script is present there should be no 404 errors. And we know it is present since you can try to save the option. This all leads me to suspect contaminated files in your installation.

You should remove all the files from your site and replace them with known good backups or with the new install files. That is the "cleansing" I mentioned.

Member
Member
easynow   11-01-2012, 02:52
#14

ah... ok i shall!

thanks!

Junior Member
Junior Member
adijoy   11-01-2012, 04:53
#15

same issue , too!

Member
Member
easynow   11-01-2012, 05:52
#16

Ok, this is a bit of a nightmare!

I have DELETED my entire zenphoto folder, after backing up my albums, some custom template_functions and my theme files.

I have DELETED my mySQL database and made a new one.

So now I am going to try and start where i left off. I just performed a clean install of 1.2.8 [4881] since it was the last version that worked with my current theme. I intend to upgrade, but one stage at a time so i can iron out theme bugs as I go.

I have uploaded one album for testing purposes, and i've noticed that mod_rewrite is working!? Well, it is at least trying to access http://domain.co.uk/myalbum/ from the gallery index, but then is reaching a 404.

I tried to turn off mod_rewrite in the admin, but when i click save on that tab, even after changing nothing, i get:

`
Not Acceptable

An appropriate representation of the requested resource /zp-core/admin-options.php could not be found on this server.
`
I would happily settle for just getting the site working so i can begin to rebuild.

Thanks for any help, I need it!

Administrator
Administrator
acrylian   11-01-2012, 10:51
#17

IF modrewrite is enabled on the admin options you also need a valid .htaccess file. Zenphoto 1.2.8 is quite old so you probably have to create it yourself using the template file within /zp-core. (I don't remember)

On current releases the setup script will warn about a missing one and offer to create it.

Member
Member
easynow   11-01-2012, 14:00
#18

yeah it has!

here is what it looks like right now:
`

htaccess file version 1.2.8.0;


When Zenphoto requires changes to the rewrite rules:


First make a copy of this file as 'oldhtaccess' in the zp-core folder so setup can test for unmodified files


Update the above and the define in setup.php


RewriteEngine On

RewriteBase /zenphoto

RewriteRule ^admin/?$ zp-core/admin.php [R,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [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/([A-Za-z0-9
-]+)/([0-9]+)/?$ index.php?p=$1&page=$2 [L,QSA]
RewriteRule ^(.)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
RewriteRule ^(.
)/page/([A-Za-z0-9_-]+)/?$ index.php?album=$1&p=$2 [L,QSA]

Rewrite rule addition for search


RewriteRule ^page/search/fields([0-9]+)/(.)/([0-9]+)/?$ index.php?p=search&searchfields=$1&words=$2&page=$3 [L,QSA]
RewriteRule ^page/search/fields([0-9]+)/(.
)/?$ index.php?p=search&searchfields=$1&words=$2 [L,QSA]
RewriteRule ^page/search/archive/(.)/([0-9]+)/?$ index.php?p=search&date=$1&page=$2 [L,QSA]
RewriteRule ^page/search/archive/(.
)/?$ index.php?p=search&date=$1 [L,QSA]
RewriteRule ^page/search/tags/(.)/([0-9]+)/?$ index.php?p=search&searchfields=tags&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/tags/(.
)/?$ index.php?p=search&searchfields=tags&words=$1 [L,QSA]
RewriteRule ^page/search/(.)/([0-9]+)/?$ index.php?p=search&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/(.
)/?$ index.php?p=search&words=$1 [L,QSA]

Rewrite additions for zenpage


RewriteRule ^pages/?$      index.php?p=pages [L,QSA]

RewriteRule ^pages/(.)/?$ index.php?p=pages&title=$1 [L,QSA]
RewriteRule ^news/?$ index.php?p=news [L,QSA]
RewriteRule ^news/([0-9]+)/?$ index.php?p=news&page=$1 [L,QSA]
RewriteRule ^news/category/(.
)/([0-9]+)/?$ index.php?p=news&category=$1&page=$2 [L,QSA]
RewriteRule ^news/category/(.)/?$ index.php?p=news&category=$1 [L,QSA]
RewriteRule ^news/archive/(.
)/([0-9]+)/?$ index.php?p=news&date=$1&page=$2 [L,QSA]
RewriteRule ^news/archive/(.)/?$ index.php?p=news&date=$1 [L,QSA]
RewriteRule ^news/(.
)/?$ index.php?p=news&title=$1 [L,QSA]

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]
RewriteRule ^(.*)/album/(thumb|[0-9]{1,4})/([^/\]+)$ zp-core/i.php?a=$1&i=$3&s=$2&album=true [L,QSA]


Catch-all - everything else gets handled in PHP for compatibility.


RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]

`
I'm a little concerned that i can't just turn it off through the control panel (or indeed even click save in the general tab of the options) without getting sent to this url:

zp-core/admin-options.php?action=saveoptions

and returning:

`
Not Acceptable

An appropriate representation of the requested resource /zp-core/admin-options.php could not be found on this server.
`

Member
Member
easynow   11-01-2012, 18:02
#19

Ok, an update:

I have noted that when I load zenpage via my root domain:

maindomain.com/zenphoto

The mod_rewrite works and I get no 404s, however i still can't use the control panel general options tab to turn it off, i get a 'not acceptable' error.

My zenphoto folder is in the web root of my site, and I have a secondary domain pointed to it:

2nddomain.com = maindomain.com/zenphoto

im so confused and i just want the site live again, mod_rewrite or not.

Administrator
Administrator
acrylian   11-01-2012, 18:15
#20

You can disable modrewrite on the options, then the htaccess file is simply ignored.

But if you use modrewrite you have to decide what domain you wish to use. The htaccess file can have only one rewrite base. (/ or /zenphoto in your examples). If you use both you need to setup redirection rules to make one domain the main one. Recommended for SEO anyway.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.