1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to rewrite url wordpress

Discussion in 'Content Management' started by martin_style, Mar 18, 2012.

  1. #1
    Example you have a site: "where-can-i-buy-a-car[dot]com"

    you want link "where-can-i-buy-a-car[dot]com/?page_id=34" Look like "where-can-i-buy-a-car[dot]com/car-online-buying"

    So, what you have to do.

    Today, I show you how to rewrite url wordpress:

    - Go to the settings and change the permalink settings mate ...

    I hope help useful

     
    martin_style, Mar 18, 2012 IP
  2. maho militia

    maho militia Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    okay, good advice
    I'll give it a try
     
    maho militia, Mar 25, 2012 IP
  3. allricjohnson

    allricjohnson Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey hi..try this code and see. hope it work for you. Thank you.


    function create_custom_rewrite_rules() {
    global $wp_rewrite;
    // Define custom rewrite tokens
    $rewrite_tag = '%exampletag%';
    // Add the rewrite tokens
    $wp_rewrite->add_rewrite_tag( $rewrite_tag, '(.+?)', 'car=' );
    // Define the custom permalink structure
    $rewrite_keywords_structure = $wp_rewrite->root . "%pagename%/$rewrite_tag/";
    // $rewrite_keywords_structure = $wp_rewrite->root . "$slug/$rewrite_tag/";
    // Generate the rewrite rules
    $new_rule = $wp_rewrite->generate_rewrite_rules( $rewrite_keywords_structure );
    // Add the new rewrite rule into the global rules array
    $wp_rewrite->rules = $new_rule + $wp_rewrite->rules;
    return $wp_rewrite->rules;
    } // End create_custom_rewrite_rules()
     
    allricjohnson, Mar 26, 2012 IP
  4. usefulfitnesstips

    usefulfitnesstips Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    On of the most important features WordPress has is permalinks rewrite engine that can create all those pretty links we are so used to with no query elements like question marks or ampersand. Did you wonder how permalinks work and what can you do to customize them? Read on.
    This article explains what happens when WordPress resolves URL request that uses pretty permalinks. This article doesn’t include examples with creating custom permalinks structures. I am planning to have additional articles to cover that.

    By default, pretty permalinks are disabled in WordPress. Reason for that is that in some cases they can’t be activated without user intervention. For pretty permalinks to work, WordPress needs access to .htaccess file (if on Apache server) where it needs to add few lines that are base for the rewrite engine in WordPress. And that also requires Apache mod_rewrite module. This module is part of Apache installations and it is very rare that it is missing. Code added into htaccess file basically redirects all URL’s to WordPress index.php and that allows WordPress to break URL into parts and using regular expressions detect what content to display.
    WordPress supports also PATHINFO permalinks that don’t require mod_rewrite module, but permalinks in that case must start with index.php. More info on this you can find on the WordPress Codex Permalinks page (links are at the end of this article). There are some setup differences in using permalinks for Apache, IIS or other servers, but they can work with any of the currently available servers for Windows, Linux or MacOS.
    So, basic thing to activate rewrite engine in WordPress is to enable permalinks from WordPress Settings/Permalinks panel. If it is set to Default, permalinks are disabled, any other value they are active.
     
    usefulfitnesstips, Mar 26, 2012 IP
  5. peoplesinnovation1

    peoplesinnovation1 Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    By Using Permalinks.
    When you create or update a "pretty" permalink structure, WordPress will generate rewrite rules and attempt to insert them into the proper
    . htaccess
    file. If it can't, it will say something like
    You should update your .htaccess now
    and print out the rules for you to copy and paste into the file (put them at the end).
     
    peoplesinnovation1, Mar 27, 2012 IP
  6. sash_007

    sash_007 Well-Known Member

    Messages:
    174
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #6
    sash_007, Apr 5, 2012 IP