wordpress and htaccess

Discussion in 'PHP' started by goodmast3r, Jan 31, 2010.

  1. #1
    I create a plugin for wordpress and creates a new RewriteRule, so mydomain.com/m123 will read as mydomain.com/page_id=45&mobile-page&mid=45

    Here is the htaccess

    RewriteEngine on

    RewriteRule ^m([0-9]+)/?$ index.php?page_id=45&mobile-page&mid=$1 [L]

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    If I use default wordpress permalink it will work, but if I use another permalink, it shows 404 error page. Anybody experience something like this?
     
    goodmast3r, Jan 31, 2010 IP
  2. USWGO

    USWGO Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    These days you don't need a plugin just for custom permalinks. You just goto your permalinks section and add something like this:

    /%postname%.htm can be set for custom permalinks which will set it to mydomain.com/my-post.htm

    Theres also plugins for advanced permalinks and even one where it automatically adds posts as html and other stuff.

    my site uswgo.com for example has it's own custom permalink and never had to modify the htacess because the wordpress system already have capabilities for seo friendly urls you just need to set it and forget it unless thats not what your asking about.

    Just thought I could help.
     
    USWGO, Feb 2, 2010 IP