.htaccess question

btblue

Joined: 2006-01-07
Posts: 64
Posted: Sun, 2010-11-14 19:46

I changed RewriteBase in .htaccess to RewriteBase /lloydsppitalnikphotography and that removed index.php from the home page URL. The problem is when I go to an Album Page or Photo page, index.php is still there as in
http://www.lloydspitalnikphotography.com/index.php/recent_work. Any solution would be greatly appreciated.
Thanks in advance. BTW I'm using the latest build of Gallery 3.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2010-11-19 20:05

Hm. Rewrite isn't really working, though, eg: http://www.lloydspitalnikphotography.com/recent_work gives me a 404. You might chat with Hostmonster about this and see if they have any tips.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Fri, 2010-11-19 22:26

That's the problem. I have to include index.php as in http://lloydspitalnikphotography.com/index.php/recent_work
I've gone into .htaccess and followed the instructions
Here is the section I changed:
# <IfModule mod_rewrite.c>
RewriteBase /~lloydspitalnikphotography.com
# </IfModule>
Do I have to put a RewriteBase for each individual album?

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Fri, 2010-11-19 22:43

This should do the trick:

RewriteBase /

--
http://inposure.se/

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Fri, 2010-11-19 22:59

changed it to RewriteBase / and still it shows index.php when I go to any album. Thanks for trying. I'm at a loss.
Here's how .htaccess looks now:
# <IfModule mod_rewrite.c>
RewriteBase /
# </IfModule>

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-11-19 23:07

Also, if G3 is installed at the root of your site as it appears, RewriteBase should be / not /lloyds....

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 00:57

Hi Kevin,
I have RewriteBase set like this:
# <IfModule mod_rewrite.c>
RewriteBase /
# </IfModule>
It still gives me index.php in the albums. Home page works properly. Just trying to figure out how to remove index.php from albums and photos.
Thanks for any help.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-11-20 01:03

That should look a lot more like this:

EDIT (oops, fixed commented lines)

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
  RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
  RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule>

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 02:04

Hi Kevin,
I hate to be a pain in the butt. I copy and pasted your code into .htaccess and now I get

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator,

and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at lloydspitalnikphotography.com Port 80

So I changed it back to before. Any other ideas? THan ks for your time and effort

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-11-20 03:03

ok. try commenting out the "if module" stuff:

# <IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
  RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
  RewriteRule ^index.php/(.*) $1 [QSA,R,L]
# </IfModule>

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 04:32

Hi again,
Here's what the .htaccess looks like now and still no success :-(

# <IfModule mod_rewrite.c>

# </IfModule>

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-11-20 04:38

Where are your rewrite rules?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 06:06

So now I'm feeling stupid and perhaps I am.
This is how .htaccess looks now. Is this correct?

# <IfModule mod_rewrite.c>
#Options +FollowSymLinks
# RewriteEngine On
# RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
# RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
# RewriteRule ^index.php/(.*) $1 [QSA,R,L]
# </IfModule>

It still isn't working the way I'd like.

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 06:06

So now I'm feeling stupid and perhaps I am.
This is how .htaccess looks now. Is this correct?

# <IfModule mod_rewrite.c>
#Options +FollowSymLinks
# RewriteEngine On
# RewriteBase /
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
# RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
# RewriteRule ^index.php/(.*) $1 [QSA,R,L]
# </IfModule>

It still isn't working the way I'd like.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2010-11-20 15:53

Not sure if I'm following. Did you remove the commenting from the actual file? Take out the "#" at the beginning of each line in that section.

 <IfModule mod_rewrite.c>
 Options +FollowSymLinks
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
 RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
 RewriteRule ^index.php/(.*) $1 [QSA,R,L]
 </IfModule>
 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-11-20 16:03

Download and rename your .htaccess to something like htaccess.txt. Then attach it to this thread.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 17:21

Here it is Kevin.

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2010-11-20 17:27

Take the "#" signs out of the last section as I wrote above. Take out the "#" at the beginning of each line in that section.

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 17:31

Hi Kevin,
I got it working :-)
I believe I was leaving # on the first and last lines or the opening and closing. I really appreciate your time like you can't imagine.
Thanks.
On a different note. I have Gallery 3 on a diferent server as thre Gallery 2 server doesn't have Apache 2.xx
I'm totally afraid to move Gallery 2 to the new server in feaqr that I'll screw it up. Any advice or would you do it for a fee?

 
btblue

Joined: 2006-01-07
Posts: 64
Posted: Sat, 2010-11-20 17:32

Thanks tempg, that did the trick. I feel so dumb.