• [Mod] Search Engine Friendly URLs aka Short URLs 3 0 5 1
Currently:  

Author Topic: [Mod] Search Engine Friendly URLs aka Short URLs  (Read 631292 times)

0 Members and 2 Guests are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #15 on: March 24, 2005, 11:43:55 PM »
its very easy ;)
here is a specific for privacy.html:
Code: [Select]
RewriteRule ^privacy\.html$ index.php?template=privacy&%{QUERY_STRING}and here is "general" that would translate every .html file into index.php?template=<name>
add it at the very end of .htaccess:
Code: [Select]
RewriteRule ^([a-zA-Z0-9_-]+)\.html$ index.php?template=$1&%{QUERY_STRING}so it should "translate" blah.html into index.php?template=blah
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 marod0er

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #16 on: March 25, 2005, 01:27:21 PM »
I should've seen that one coming :)

anyway, thanks - i'll try it out when I get around to it.
Greetz: Lasse

Offline G4

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #17 on: March 25, 2005, 03:07:03 PM »
does mod rewrite change the files on the server?
or are the *.htm files only temporary created? im afraid of destroying my files with this mod

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #18 on: March 26, 2005, 04:05:34 AM »
mod rewrite does not change the files, all it does it make the server handle the requests differently.
I can not say for sure what would happend if u have index.html file and with mod rewrite it would "translate" index.html into index.php
I havent test it myself yet ;)

P.S. its a good question though.

[edit] checked and mod_rewrite overule the existing files...meaing index.html file can not be accessed if mod_rewrite "translate" index.html into index.php
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 seksihatun

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #19 on: March 29, 2005, 07:32:59 PM »
Hi
is it true for second page
RewriteRule ^hatunlar([0-9]+)\.([0-9]+)\.htm$ categories.php?cat_id=$1&page=$2&%{QUERY_STRING}
because when i put like this i am getting error like

http://www.website.com/.htmhtm=31?page=2

what is problem???
my session.php is

     if (isset($matches1[1]) && isset($matches2[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'hatunlar'.$matches1[1].'.'.$matches2[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches1[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches1[1], '', $query);
            $query = str_replace('cat_id='.$matches1[1], '', $query);
            $query = str_replace('page='.$matches2[1].'&', '', $query);
            $query = str_replace('&page='.$matches2[1], '', $query);
            $query = str_replace('page='.$matches2[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        elseif (strstr($url, 'cat_id=')) {
          preg_match('#cat_id=([0-9]+)&?#', $url, $matches);
          if (isset($matches[1])) {
            $split = explode('?', $url);
            $url = $split[0];
            $query = @$split[1];
            $url   = str_replace('categories.php', 'hatunlar'.$matches[1].'.htm', $url);
            $query = str_replace('cat_id='.$matches[1].'&', '', $query);
            $query = str_replace('&cat_id='.$matches[1], '', $query);
            $query = str_replace('cat_id='.$matches[1], '', $query);
            if (!empty($query)) {
              $url .= '?' . $query;
            }
          }
        }
        else {
          $url = str_replace('categories.php', 'hatunlar.htm', $url);
        }

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #20 on: March 29, 2005, 07:38:53 PM »
Hi
is it true for second page
RewriteRule ^hatunlar([0-9]+)\.([0-9]+)\.htm$ categories.php?cat_id=$1&page=$2&%{QUERY_STRING}
because when i put like this i am getting error like

http://www.website.com/.htmhtm=31?page=2
the question is: did it work BEFORE u changed the original code of this "mod"? (I'm talking about the code posted on first page)
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 seksihatun

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #21 on: March 29, 2005, 07:49:13 PM »
no i changed to original code posted first page in this subject.it did not work..

still they like
http://www.website.com/.htmhtm=379?page=2

but there is no problem first page of category
http://www.website..com/cat379.htm

Offline tikle

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #22 on: March 30, 2005, 03:40:25 AM »
Forbidden
You don't have permission to access / on this server.

Apache/1.3.33 Server at www... Port 80

 :(

 :?:


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #23 on: March 30, 2005, 04:02:11 AM »
Forbidden
You don't have permission to access / on this server.

Apache/1.3.33 Server at www.fotomir.de Port 80

 :(

 :?:
too bad
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 nX

  • Pre-Newbie
  • Posts: 1
    • View Profile
    • ZookCom
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #24 on: March 30, 2005, 03:27:35 PM »
Thanks for this great mod.
It`s working smoothly.

Now the time of waiting-for-the-google-bot hat startet again  :mrgreen:

Offline Legendary

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.idols-unlimited.com
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #25 on: March 30, 2005, 05:31:43 PM »
It is possible to change cat#.htm and img#.htm to their name instead?

Example:  if the name for "cat1.htm" is say Family Pictures, is there a way to change it to FamilyPictures.htm?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #26 on: March 30, 2005, 07:31:47 PM »
It is possible to change cat#.htm and img#.htm to their name instead?

Example: if the name for "cat1.htm" is say Family Pictures, is there a way to change it to FamilyPictures.htm?
no, its not. As I tryed explained several times before the hack, 4images is based on IDs (category id, image id, user id, etc) and names could be the same for each item, there for if it happend that u have two category with the same name, which category would u show?
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 tikle

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #27 on: March 30, 2005, 10:03:32 PM »
Forbidden
You don't have permission to access / on this server.

Apache/1.3.33 Server at www.fotomir.de Port 80

 :(

 :?:
too bad

what can i doo?


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #28 on: March 30, 2005, 10:16:14 PM »
what can i doo?
u could start by explaining what is the problem and how/when it accures.
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 Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [Mod] Search Engine Friendly URLs aka Short URLs
« Reply #29 on: April 03, 2005, 09:25:44 PM »
i got a error
homepage not available!
why this happen?

sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


 

Post your comments here