Help me re-write index.php Expert Enter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help me re-write index.php Expert Enter

    i want re-write my index.php
    it output now loking
    Code:
    http://rexmob.com/index.php?page=category&id=889&indir=Mobile-Themes
    but i want
    Code:
    http://rexmob.com/category/889/Mobile-Themes.html

    and this is my index.php
    Code:
    <a href=\"index.php?page=category&id=$value->id&indir=$lname\">$name
    </a> [$fCount]
    i need only rewite on and some modify in my .htaccess file or need put some change in my index.php plz help me urgent expert bro...
    tnx advace..

    Added after 26 minutes:

    i try it my self but not working
    Code:
    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?page=$1&id=$2&indir=$3 [L]
    Last edited by BDplanet; 16.04.12, 12:26.

    #2
    Originally posted by BDplanet View Post
    i want re-write my index.php
    it output now loking
    Code:
    http://rexmob.com/index.php?page=category&id=889&indir=Mobile-Themes
    but i want
    Code:
    http://rexmob.com/category/889/Mobile-Themes.html

    and this is my index.php
    Code:
    <a href=\"index.php?page=category&id=$value->id&indir=$lname\">$name
    </a> [$fCount]
    i need only rewite on and some modify in my .htaccess file or need put some change in my index.php plz help me urgent expert bro...
    tnx advace..

    Added after 26 minutes:

    i try it my self but not working
    Code:
    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?page=$1&id=$2&indir=$3 [L]

    The rewrite rulle is good

    try and put this on your index .. and see if it works

    <a href=\"/category/$value->id/$lname.html\">$name</a> [$fCount]
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

    Comment


      #3
      Originally posted by BDplanet View Post
      i want re-write my index.php
      it output now loking
      Code:
      http://rexmob.com/index.php?page=category&id=889&indir=Mobile-Themes
      but i want
      Code:
      http://rexmob.com/category/889/Mobile-Themes.html

      and this is my index.php
      Code:
      <a href=\"index.php?page=category&id=$value->id&indir=$lname\">$name
      </a> [$fCount]
      i need only rewite on and some modify in my .htaccess file or need put some change in my index.php plz help me urgent expert bro...
      tnx advace..

      Added after 26 minutes:

      i try it my self but not working
      Code:
      RewriteEngine On
      RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?page=$1&id=$2&indir=$3 [L]

      Try,
      RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ index.php?page=category&id=$1&indir=$2[L]

      xD

      If ur category not fixed variable use ([a-z]+) since it is in lower case
      Last edited by m4ster_v4; 16.04.12, 12:58. Reason: Fixed some code
      sigpic
      Visit my WEBSITE Project: http://www.aspirewap.net

      Comment


        #4
        Originally posted by BDplanet View Post
        i want re-write my index.php
        it output now loking
        Code:
        http://rexmob.com/index.php?page=category&id=889&indir=Mobile-Themes
        but i want
        Code:
        http://rexmob.com/category/889/Mobile-Themes.html
        Its like this. ;)

        Code:
        RewriteRule ^/page/([a-z]+)/id/([0-9]+)/indir/([a-zA-Z-]+)\.html$ index.php?page=$1&id=$2&indir=$3
        Last edited by arnage; 16.04.12, 13:03.
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          Originally posted by arnage View Post
          Its like this. ;)

          Code:
          RewriteRule ^/page/([a-z]+)/id/([0-9]+)/indir/([a-zA-Z-]+)\.html$ index.php?page=$1&id=$2&indir=$3
          Does it will return
          Code:
          http://rexmob.com/page/category/id/889/indir/Mobile-Themes.html
          ? m8?
          Just asking for knowledge purpose. ^^
          sigpic
          Visit my WEBSITE Project: http://www.aspirewap.net

          Comment


            #6
            Yep.

            somesite.tld/page/category/id/889/indir/Mobile-Themes.html


            This,

            category/889/Mobile-Themes.html

            ... i never tried to rewrite, i think its should be the code like,

            PHP Code:
            if (isset($_GET['category'])) {
            if (isset(
            $_GET['id'])) {
            if (isset(
            $_GET['Mobile-Themes'])) {
            // page...
            }
            }

            But i guess its not the case here.
            Last edited by arnage; 16.04.12, 14:11.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment


              #7
              Originally posted by arnage View Post
              Its like this. ;)

              Code:
              RewriteRule ^/page/([0-9]+)/id/([0-9]+)/indir/([a-zA-Z-]+)\.html$ index.php?page=$1&id=$2&indir=$3
              For me it works like this

              PHP Code:
              <?php 
              /* make a php file named checkitout.php 

              and add.htaccess lines 

              RewriteEngine on
              RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /checkitout.php?page=$1&id=$2&indir=$3 [L]

              */ 

              /*Now let's check it out :D */

              if(isset($_GET['page'])){echo 'Page-> '.$_GET['page'].' &amp; Id -> '.$_GET['id'].' &amp; Indir -> '.$_GET['indir'].'';}

              else{
              $myid='889';
              $mydir='My-wap-category';

              // link is looking like this http://127.0.0.1/category/889/My-wap-category.html

              echo "<a href=\"/category/$myid/$mydir.html\">Test rewrite</a> ";}

              ?>
              This is ten percent luck, twenty percent skill
              Fifteen percent concentrated power of will
              Five percent pleasure, fifty percent pain

              And a hundred percent reason to remember the name!

              Comment


                #8
                Originally posted by just_m3. View Post
                For me it works like this

                PHP Code:
                <?php 
                /* make a php file named checkitout.php 

                and add.htaccess lines 

                RewriteEngine on
                RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /checkitout.php?page=$1&id=$2&indir=$3 [L]

                */ 

                /*Now let's check it out :D */

                if(isset($_GET['page'])){echo 'Page-> '.$_GET['page'].' &amp; Id -> '.$_GET['id'].' &amp; Indir -> '.$_GET['indir'].'';}

                else{
                $myid='889';
                $mydir='My-wap-category';

                // link is looking like this http://127.0.0.1/category/889/My-wap-category.html

                echo "<a href=\"/category/$myid/$mydir.html\">Test rewrite</a> ";}

                ?>
                Posted link was index.php?page=category&id=889&indir=Mobile-Themes and for that this is not gonna work without recoding php, which is totally different story. ;)
                <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                Comment


                  #9
                  Originally posted by arnage View Post
                  Posted link was index.php?page=category&id=889&indir=Mobile-Themes and for that this is not gonna work without recoding php, which is totally different story. ;)
                  Yupe' thats true, but he also said that want the link to look like this



                  and not like http://somesite.tld/page/category/889/My-wap-category.html

                  if he want that result he should put some bones to work : D ..
                  Last edited by just_m3.; 16.04.12, 13:42.
                  This is ten percent luck, twenty percent skill
                  Fifteen percent concentrated power of will
                  Five percent pleasure, fifty percent pain

                  And a hundred percent reason to remember the name!

                  Comment


                    #10
                    Originally posted by m4ster_v4 View Post
                    Try,
                    RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ index.php?page=category&id=$1&indir=$2[L]

                    xD

                    If ur category not fixed variable use ([a-z]+) since it is in lower case
                    why im lossing css and all img view see here

                    Comment


                      #11
                      Originally posted by BDplanet View Post
                      why im lossing css and all img view see here
                      okay use this RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ /home/USERNAME/public_html/index.php?page=category&id=$1&indir=$2[L]

                      change USERNAME with ur accout name. this is my basic knowledge maybe can try other codes ^^

                      or just add / before index /index.php maybe. not test yet
                      Last edited by m4ster_v4; 16.04.12, 13:49. Reason: bbcode
                      sigpic
                      Visit my WEBSITE Project: http://www.aspirewap.net

                      Comment


                        #12
                        Originally posted by BDplanet View Post
                        why im lossing css and all img view see here
                        Use http://linked.tld/style.css instead ./style.css because rewrite rulles can skrew things ...
                        This is ten percent luck, twenty percent skill
                        Fifteen percent concentrated power of will
                        Five percent pleasure, fifty percent pain

                        And a hundred percent reason to remember the name!

                        Comment


                          #13
                          Originally posted by m4ster_v4 View Post
                          okay use this RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ /home/USERNAME/public_html/index.php?page=category&id=$1&indir=$2[L]

                          change USERNAME with ur accout name. this is my basic knowledge maybe can try other codes ^^

                          or just add / before index /index.php maybe. not test yet
                          same



                          Code:
                          RewriteEngine On
                          RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ /home/rexmob/public_html/index.php?page=category&id=$1&indir=$2[L]
                          here is my index.php plz fix it
                          Attached Files

                          Comment


                            #14
                            Originally posted by BDplanet View Post
                            same



                            Code:
                            RewriteEngine On
                            RewriteRule ^category/([0-9]+)/([a-zA-Z_-]+).html$ /home/rexmob/public_html/index.php?page=category&id=$1&indir=$2[L]
                            here is my index.php plz fix it
                            if include remove ./ eg: include "lol.php";, include ("lol.php");
                            if link, photo add / eg: /index.php, /img/logo.gif, /css/style.css

                            Just from my experience.
                            sigpic
                            Visit my WEBSITE Project: http://www.aspirewap.net

                            Comment


                              #15
                              Originally posted by m4ster_v4 View Post
                              if include remove ./ eg: include "lol.php";, include ("lol.php");
                              if link, photo add / eg: /index.php, /img/logo.gif, /css/style.css

                              Just from my experience.
                              if dubble dot

                              eg: ../some.php wt i can do?

                              Comment

                              Working...
                              X