SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Rewrite folder name

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rewrite folder name

    How could I rewrite the folder name? for instant, http://foo.com/adminfolder

    Thanks

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,315
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    MTV,

    To what?

    That's really a very basic question so I would recommend some reading about mod_rewrite and regex. I've got an article in my signature that may help (from experience in this forum).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn
    MTV,

    To what?

    That's really a very basic question so I would recommend some reading about mod_rewrite and regex. I've got an article in my signature that may help (from experience in this forum).

    Regards,

    DK
    http://foo.com/adminfolder -> http://foo.com/folder

    I just want to rename the folder name

    Thanks DK

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,315
    Mentioned
    15 Post(s)
    Tagged
    2 Thread(s)
    MTV,

    Oh, okay.
    Code:
    RewriteRule ^/?admin([a-z]+)$ /$1 [R=301,L]
    will do PRECISELY that and NO more.

    Okay, that's my "Specificity" soapbox. If you want to redirect links into the adminfolder to folder,
    Code:
    RewriteRule ^/?admin([a-z]+)(/[a-z./]+)?$ /$1$2 [R=301,L]
    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    Updated mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

Bookmarks

Posting Permissions

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