Author Topic: Confused with strange problem when making seo friendly urls  (Read 7544 times)

0 Members and 1 Guest are viewing this topic.

Offline dilkebol

  • Newbie
  • *
  • Posts: 34
    • View Profile
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.


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Confused with strange problem when making seo friendly urls
« Reply #1 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}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline dilkebol

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Confused with strange problem when making seo friendly urls
« Reply #2 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Confused with strange problem when making seo friendly urls
« Reply #3 on: June 29, 2009, 04:18:30 PM »
we have 2 SEO mods that use this code. You can start from there.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline dilkebol

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Confused with strange problem when making seo friendly urls
« Reply #4 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

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Confused with strange problem when making seo friendly urls
« Reply #5 on: June 29, 2009, 04:50:32 PM »
Please 1st search the forum.. you will get the related post..


Offline dilkebol

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Confused with strange problem when making seo friendly urls
« Reply #6 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Confused with strange problem when making seo friendly urls
« Reply #7 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)