Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Static url issue!

  1. #1
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default Static url issue!

    By default,we use PHP itself to implement static url without Mod_rewrite module.But this need install PHP as module of apache.

    If PHP is installed as CGI module,you will not view images by static url, such as http://yourdomain.com/out.php/filename.jpg.

    If you can not edit php.ini to modify this,you can use mod_rewrite to make static url:
    1.Find these lines in ".htaccess":
    Code:
    #RewriteRule   ^show\.php/(.*)$ show2.php?img=$1 [L]
    #RewriteRule   ^out\.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L]
    #RewriteRule   ^view\.php/(.*)$ view2.php?img=$1 [L]
    #RewriteRule   ^image\.php/([a-z]{1})(.*)$ images2.php?$1=$2&%{QUERY_STRING} [L]
    Uncoment these lines:
    Code:
    RewriteRule   ^show\.php/(.*)$ show2.php?img=$1 [L]
    RewriteRule   ^out\.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L]
    RewriteRule   ^view\.php/(.*)$ view2.php?img=$1 [L]
    RewriteRule   ^images\.php/([a-z]{1})(.*)$ images2.php?$1=$2&%{QUERY_STRING} [L]
    2.Rename these files to new names:
    Code:
    show.php->show2.php
    out.php->out2.php
    view.php->view2.php
    image.php->image2.php
    3.Remember to enable static url from admin panel:
    To enable static url,login in admin panel,browser to "Site>configuration>URL-Rewrite Setting",select 'yes' for "Enable Static Url for site?".
    Last edited by yabsoft; 10-23-2006 at 03:07 PM. Reason: Fix a hotlink issue: http://yabsoft.com/forum/showthread.php?t=830

  2. #2

    Default

    sorry for this but i still cant configer this static url thing

    here is mine edited

    PHP Code:
    RewriteEngine on
    ##point to installation directory
    ##if it is the root dir,enter /
    ##else /otherdir
    RewriteBase  /

    ## uncomment(i.e:remove # ) below lines if the static url doesn't work
    ## and rename show.php -> show2.php, out.php -> out2.php, view.php -> view2.php, images.php -> images2.php,  
    RewriteRule   ^show2\.php/(.*)$ show2.php?img=$[L]
    RewriteRule   ^out2\.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L]
    RewriteRule   ^view2\.php/(.*)$ view2.php?img=$[L]
    RewriteRule   ^images2\.php/([a-z]{1})(.*)$ images2.php?$1=$2&%{QUERY_STRING} [L]

    RewriteRule   ^gallery/([0-9]+)-([^/]*)/(.*)$ gallery.php?gal=$1&img=$[L]
    RewriteRule   ^view/([0-9]+)-([^/]*)/(.*)$ gallery_body.php?gal=$1&img=$[L

    i dont know if i need to edit these things / i did and i had an error so i dont know what more to do

  3. #3
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Quote Originally Posted by chri$ View Post
    sorry for this but i still cant configer this static url thing

    here is mine edited

    PHP Code:
    RewriteEngine on
    ##point to installation directory
    ##if it is the root dir,enter /
    ##else /otherdir
    RewriteBase  /
     
    ## uncomment(i.e:remove # ) below lines if the static url doesn't work
    ## and rename show.php -> show2.php, out.php -> out2.php, view.php -> view2.php, images.php -> images2.php,  
    RewriteRule   ^show2\.php/(.*)$ show2.php?img=$[L]
    RewriteRule   ^out2\.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L]
    RewriteRule   ^view2\.php/(.*)$ view2.php?img=$[L]
    RewriteRule   ^images2\.php/([a-z]{1})(.*)$ images2.php?$1=$2&%{QUERY_STRING} [L]
     
    RewriteRule   ^gallery/([0-9]+)-([^/]*)/(.*)$ gallery.php?gal=$1&img=$[L]
    RewriteRule   ^view/([0-9]+)-([^/]*)/(.*)$ gallery_body.php?gal=$1&img=$[L

    i dont know if i need to edit these things / i did and i had an error so i dont know what more to do
    Sorry for the confusion.

    The correct .htaccess should be
    PHP Code:
    RewriteEngine on
    ##point to installation directory
    ##if it is the root dir,enter /
    ##else /otherdir
    RewriteBase  /
     
    ## uncomment(i.e:remove # ) below lines if the static url doesn't work
    ## and rename show.php -> show2.php, out.php -> out2.php, view.php -> view2.php, images.php -> images2.php,  
    RewriteRule   ^show\.php/(.*)$ show2.php?img=$[L]
    RewriteRule   ^out\.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L]
    RewriteRule   ^view\.php/(.*)$ view2.php?img=$[L]
    RewriteRule   ^images\.php/([a-z]{1})(.*)$ images2.php?$1=$2&%{QUERY_STRING} [L]
     
    RewriteRule   ^gallery/([0-9]+)-([^/]*)/(.*)$ gallery.php?gal=$1&img=$[L]
    RewriteRule   ^view/([0-9]+)-([^/]*)/(.*)$ gallery_body.php?gal=$1&img=$[L
    And you need rename these files in your root directory, not the name in .htaccess:
    show.php -> show2.php, out.php -> out2.php, view.php -> view2.php, images.php -> images2.php,

  4. #4

    Default

    Quote Originally Posted by yabsoft View Post
    Sorry for the confusion.
    It turns out not absolutely static url.
    {Links} turn out a kind show.php/blablabla.html
    How to make what {links} were show/blablabla.html

  5. #5

    Default

    How can i apply these into lighttpd ?

  6. #6
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Quote Originally Posted by D4rKNull View Post
    How can i apply these into lighttpd ?
    Try the rules in https://yabsoft.com/forum/free-trial...light=Lighttpd

  7. #7

    Default

    hi, i tried this but static urls still not working for me. i am getting the following error:

    The requested URL /gallery_body.php was not found on this server.

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

    i have renamed these files as mentioned:

    show.php -> show2.php, out.php -> out2.php, view.php -> view2.php, images.php -> images2.php,
    my .htaccess has these line:

    RewriteRule ^gallery/([0-9]+)-([^/]*)/(.*)$ gallery.php?gal=$1&img=$3 [L]
    RewriteRule ^viewimg/([0-9]+)-([^/]*)/(.*)$ gallery_body.php?gal=$1&img=$3 [L]

  8. #8

    Default

    can anyone throw light on my problem please?

  9. #9

    Default

    I need the .htaccess for nginx.

    Thanks you

  10. #10

    Default

    Same here. Can yab please help to post the rewrite rules for nginx here?

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •