SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: How do i change

  1. #1
    Non-Member
    Join Date
    Nov 2011
    Location
    United States
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do i change

    Hi Friends,

    How do i rewrite dynamic page url's into search engine friendly url for whole website? Should i need to add mod-rewrite code? If so, can you please share with me here mod-rewrite code.

    Awaiting for your reply...

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,619
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    You probably need to give some indication of your URL structures so that suggestions can be given on how to rewrite them. Can you post a few examples? (They don't have to include your real domain if you prefer not to reveal it.)

  3. #3
    Non-Member
    Join Date
    Nov 2011
    Location
    United States
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    You probably need to give some indication of your URL structures so that suggestions can be given on how to rewrite them. Can you post a few examples? (They don't have to include your real domain if you prefer not to reveal it.)
    My website pages are displaying following types of url's,

    http://www.example.com/index.php?opt...d=25&Itemid=82

    http://www.example.com/index.php?opt...d=28&Itemid=86

    How do i redirect all my pages to search engine friendly url's?

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

    Check the mod_rewrite tutorial (with sample code) linked in my signature for your answers. Then consider what I've done at http://wilderness-wally.com for his links (using the page title rather than Itemid as you're using) - that's SEO Friendly!

    Regards,

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

  5. #5
    Non-Member
    Join Date
    Nov 2011
    Location
    United States
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi dklynn,

    Can i use this rewrite for my site?

    RewriteCond %{IS_SUBREQ} false
    RewriteCond %{QUERY_STRING} id=([a-zA-Z]+)
    RewriteRule ^index\.php$ %1? [R=301,L]

    Is this right code?

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

    Yes, you could but that would redirect from a file that Apache can server to something it cannot, i.e., 404. Please reread the tutorial as one of the first lessons is the direction of the mod_rewrite direction (from something which can't be served to something that it can serve - okay, you can program "loopy" redirections, too, but that's a more advanced topic). Have another look at http://wilderness-wally.com/ and look at the article URIs (which are all article titles, not IDs and certainly not file names).

    Regards,

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

  7. #7
    Non-Member
    Join Date
    Nov 2011
    Location
    United States
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    LGW,

    Yes, you could but that would redirect from a file that Apache can server to something it cannot, i.e., 404. Please reread the tutorial as one of the first lessons is the direction of the mod_rewrite direction (from something which can't be served to something that it can serve - okay, you can program "loopy" redirections, too, but that's a more advanced topic). Have another look at http://wilderness-wally.com/ and look at the article URIs (which are all article titles, not IDs and certainly not file names).

    Regards,

    DK
    ok let me try that code....


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
  •