Posts Tagged ‘.htaccess’

解决Open Web Analytics载入文件失败的问题

如果你的wordpress安装在子目录,而使用根目录进行访问,会生成一个.htaccess,但这个规则可能会造成子目录访问失败。我这篇文章[cross id=1987]中也提供了一个解决方案,但我发现我的主页中访问子目录还是存在问题。

所以最终我选择了修改Open Web Analytics插件的方式。主要是调整访问wp-content的路径。

查找到wp-plugin.php包含一句:

define('OWA_PUBLIC_URL', get_bloginfo('url').'/wp-content/plugins/owa/public/');

修改为

define('OWA_PUBLIC_URL', get_bloginfo('wpurl').'/wp-content/plugins/owa/public/');

即可。此时将使用wordpress绝对路径进行访问。

Fix WordPress default .htaccess and 401 error

I encourted a problem that I couldn't see the dialog for my password protected pages. The problem was caused by WordPress default .htaccess file which redirect 401 page to 404 page. The more detail can be found here (http://www.andrewrollins.com/2008/01/22/wordpress-and-htaccess-password-protected-directories/)

I've tried three methods the article said and only found the last one is OK. I created a 401 page and put this line into .htaccess and every went well.

ErrorDocument 401 /401.shtml

I didn't know the reason for the failure of another two failed because my new hosting server is LiteSpee which may not fully compatible with Apache.