4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: dilkebol on June 29, 2009, 03:37:49 PM

Title: Confused with strange problem when making seo friendly urls
Post by: dilkebol on June 29, 2009, 03:37:49 PM
I am using 4images gallery version 1.7.6 for my site & I did changes to .htaccess file which is placed within /public_html/ folder.
Code is as below .. I tried about 5-6 formats & also tried both uploading mode (Auto & ASCII)
My .htaccess file
--
RewriteEngine On

#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}

#Mod_bmollet : This is to make search function work  ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
---
Sessions.php which is in /gallery/includes/ folder is also modified.
I uploaded one image in category named "celeb" when .htaccess & sessions.php was not modified.
Now when I try to view that image (image name is "the-hangover-1v".jpg), I get message as below

+++++
Not Found
The requested URL /seo/img1.htm was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.25 mod_perl/2.0.4 Perl/v5.8.8 Server at www.mysitename.com Port 80
+++

Image name is "the-hangover-1v".jpg",they why this error /img.htm I am getting.
I am only able to see home page,Kindly help me  :?
 
Lots of thanks in advance.

Title: Re: Confused with strange problem when making seo friendly urls
Post by: V@no on June 29, 2009, 03:54:08 PM
you don't have a rule for such format.
what you have is for urls like: img-blah-1.htm,  img1.search.htm and img1.lightbox.htm (the last two practically the same as the first one, which makes them useless because no prev/next images will be showed correctly from the search result or lightboxes)

Code: [Select]
RewriteRule ^img([0-9]+)\.htm$ details.php?image_id=$1&%{QUERY_STRING}
Title: Re: Confused with strange problem when making seo friendly urls
Post by: dilkebol on June 29, 2009, 04:15:27 PM
Thanks guru,
Can you please give me correct code for .htaccess & sessions.php
I tried much codes but was unsuccessful.
1.7.6 version
Title: Re: Confused with strange problem when making seo friendly urls
Post by: V@no on June 29, 2009, 04:18:30 PM
we have 2 SEO mods that use this code. You can start from there.
Title: Re: Confused with strange problem when making seo friendly urls
Post by: dilkebol on June 29, 2009, 04:20:21 PM
I tried about 100 times uploading. But none is working atleast 1 % :(
Can u please post.
If not please give me link
Title: Re: Confused with strange problem when making seo friendly urls
Post by: batu544 on June 29, 2009, 04:50:32 PM
Please 1st search the forum.. you will get the related post..

Title: Re: Confused with strange problem when making seo friendly urls
Post by: dilkebol on June 29, 2009, 04:53:11 PM
There are total 28 pages . Tried every code :P
It seems it does not works with 1.7.6 .
If someone can do it & paste code here then it's great surprise for me
Title: Re: Confused with strange problem when making seo friendly urls
Post by: V@no on June 30, 2009, 01:50:54 AM
it works with any versions. it's been tested and confirmed. If it doesn't work for you then it either you do something wrong (aka trying change something by yourself) or your server doesn't meet needed requirements, such as doesn't have mod_rewrite.