SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    437
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    wordpress Url rewrite doesn't work

    I created a sub-file named blog in my site's server. access the blog url is:
    Code:
    http://example.com/blog or http://example.com/blog/?p=123
    when i checked Post name checkbox item http://www.example.com/blog/index.php/sample-post/ in the Permalink Settings part. when i access post. it shows not found. when i unenabled the url rewrite. when view all the post,all are ok.

    my server supports the url rewrite.then i created .htaccess(644). put it into blog file and put code:

    HTML Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    it still can't work. why?

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

    If you installed WP in a subdirectory (blog), then this is the .htaccess which WP will write for you. Because the mod_rewrite is specifically for WP, I'd remove the RewriteBase directive and move it (without the <IfModule>...</IfModule> wrappers) to the blog subdirectory. Also, the first RewriteRule is inane (it's already handled by the first RewriteCond statement).

    Your test URI then, is incorrect as you should NOT have index.php in the path (that would create an Options MultiViews problem).

    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

  3. #3
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    437
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dklynn View Post
    RED,

    If you installed WP in a subdirectory (blog), then this is the .htaccess which WP will write for you. Because the mod_rewrite is specifically for WP, I'd remove the RewriteBase directive and move it (without the <IfModule>...</IfModule> wrappers) to the blog subdirectory. Also, the first RewriteRule is inane (it's already handled by the first RewriteCond statement).

    Your test URI then, is incorrect as you should NOT have index.php in the path (that would create an Options MultiViews problem).

    Regards,

    DK
    thank you, i delete those lines which is inane. but it is still not work?


    in my server, i installed the magento, the magento has .hactess. i don't know whether it affect the wordpress. then created a sub-floder named blog, then put the wordpress source code in it.

  4. #4
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    437
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i am very very sorry. my web server is ngnix.

  5. #5
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RED,

    More information but I only have questions: Both Magento and Word Press installed? If so, only allow their .htaccess in their own subdirectory or one will hijack the other.

    ngnix? I'm not familiar with that. If that's your web server, then it might not have an equivalent to .htaccess but, if an OS, it should be okay so long as Apache can install on it.

    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

  6. #6
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by dklynn View Post
    RED,
    ngnix? I'm not familiar with that. If that's your web server, then it might not have an equivalent to .htaccess but, if an OS, it should be okay so long as Apache can install on it.
    Nginx is a high performance web server/web proxy/imap and pop3 server. It doesn't use the threaded approach that Apache uses, features predictable memory usage and scales to high performance better as Apache begins to slow down with concurrent connections however ngnix does not. Nginx does allow rewriting

    One has to use the appropriate rewritting syntax for Nginx and also convert their .htaccess files.
    ictus==""


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
  •