I have a WordPress installation on my website on the folder blog-ita/
. Now, I’d like to add a rewrite rule to allow accessing it from website-name/blog/
.
I used this rewrite rule:
RewriteRule ^website-name/blog/(.*)$ blog-ita/$1
Now, this works if I add the [R] tag, but otherwise I get the 404 not found page from wordpress instead of the page I wanted to see.
How can that be? How can I make this work without the [R]
flag?
You can follow this guide from WordPress to get WordPress to work in a different directory than wordpress is actually located.
You want to install wordpress in the
blog-ita
directory. You want the url to showwebsite-name/blog
instead. Follow the following steps:http://example.com/website-name/blog
htttp://example.com/blog-ita
./blog-ita
and paste them in/website-name/blog
. You need to copy, not move./website-name/blog
in your favourite text editor and change the line that saysrequire( dirname( __FILE__ ) . '/wp-blog-header.php' );
to point at the same file in the directory where wordpress is installed. In this case it should be changed torequire( dirname( __FILE__ ) . '../blog-ita/wp-blog-header.php' );
. Save the changes.From this point on, wordpress should be available at
http://example.com/website-name/blog/
. The admin section is only available at the actual installation directory (/blog-ita/admin
).