我在 Amazon EC2 上安装了一个 Bitnami Ubuntu Wordpress 实例。
Bitnami 实例上的wordpress.conf
文件就像一个 htaccess 文件。
目录结构如下:
/opt/bitnami/apps/wordpress/htdocs/index.php
该wordpress.conf
文件包含
Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/"
Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options Indexes MultiViews +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</Directory>
# Uncomment the following lines to see your application in the root
# of your URL. This is not compatible with more than one application.
#RewriteEngine On
#RewriteRule ^/$ /wordpress/ [PT]
这使得博客出现在这个 URL 上
http://ec2instance.com/wordpress/
我希望它是(包括查看单个帖子时):
http://ec2instance.com/blog/
http://ec2instance.com/blog/post-number-1
http://ec2instance.com/blog/post-number-2
ETC
有人知道如何进行此更改吗?