Wordpress Url rewrite doesn't work

I created a sub-file named blog in my site’s server. access the blog url is:

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:

# 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?

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.

i am very very sorry. my web server is ngnix.

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

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.