Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    URL Rewriting using .htaccess and mod_rewrite php

    I need help to rewrite my URL for better promotion.

    My link is

    http://www.domain.com/bb/cat_sell.php?cid=1

    where cid=1 is Agriculture

    Now i want url like this

    http://www.domain.com/bb/category/Agriculture.html

    and this is the ad posted in that category :

    http://www.domain.com/bb/view_offer.php?id=37

    I want url like this

    http://www.domain.com/bb/selloffer/37/offername.html



    I have web hosting with mod_rewrite on.

    I tried using .htaccess file and placed in "bb" directory but it didn't change.

    There is no such directory liek category or selloffer but i want it in the url.

    Can any one help me the write process and what should be wirtten in .htaccess file.

  • #2
    Regular Coder
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    118
    Thanks
    8
    Thanked 2 Times in 2 Posts
    First, is /bb/ a real directory? Because you are able to create fake directories with mod_rewrite. My example will be used in a file that is in public_html directory.

    Code:
    RewriteRule ^bb/category/agriculture.html*$ cat_sell.php?cid=1
    With this rewrite rule can you now changed your dynamic link into

    Code:
    http://www.domain.com/bb/category/agriculture.htm
    Hope this helped.

  • #3
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mod rewirte using htaccess

    Quote Originally Posted by CyberPirate View Post
    First, is /bb/ a real directory? Because you are able to create fake directories with mod_rewrite. My example will be used in a file that is in public_html directory.

    Code:
    RewriteRule ^bb/category/agriculture.html*$ cat_sell.php?cid=1
    With this rewrite rule can you now changed your dynamic link into

    Code:
    http://www.domain.com/bb/category/agriculture.htm
    Hope this helped.
    ya bb is real directory it like this www.domain.com/bb/cat_sell.php

    now all the categories are generated dynamically like for Agriculture cid = 1 my script creates as many ids.

    as per above i have to write rewrite rule for each and every category.

    can i have a single rewrite rule to take the cat-id automatically.

    like for ex.

    www.domain.com/bb/category/agriculture.html
    www.domain.com/bb/category/handicraft.html

    i have edited the code and its give me the link as below.

    www.domain.com/bb/cat_sell.php?cname=Agriculture

    cname can me many in my site..

  • #4
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i need relly help
    i want to change my url my url is
    http://www.myname/index.php?id=1
    http://www.myname/index.php?id=2
    http://www.myname/index.php?id=3
    http://www.myname/index.php?id=4 etc

    i want to change it

    http://www.myname/index.php/category/category name instead of id number
    and its name is change at any time it is dynamic url.

    pleade help me send me its coding
    Thanks


    Quote Originally Posted by CyberPirate View Post
    First, is /bb/ a real directory? Because you are able to create fake directories with mod_rewrite. My example will be used in a file that is in public_html directory.

    Code:
    RewriteRule ^bb/category/agriculture.html*$ cat_sell.php?cid=1
    With this rewrite rule can you now changed your dynamic link into

    Code:
    http://www.domain.com/bb/category/agriculture.htm
    Hope this helped.

  • #5
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    URL Rewriting using .htaccess php

    Hi All,
    I need help to rewrite my URL for better promotion.

    My link is

    http://www.domain.com/pages.php?u=company

    Now i want url like this

    http://www.domain.com/company.html

    Please help me.


  •  

    Tags for this Thread

    Posting Permissions

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