View Full Version : Wordpress + Quercus + Pretty permalinks (SEO Friendly URLs)

10-10-2011, 05:49 PM
Hi there,
I have installed wordpress as subfolder in my Java web app.
The subfolder is named "articles".

Almost everything works well, however I have only one problem.
I cannot get pretty permalinks working.
I keep getting a 404 error for all SEO friendly blog post URLs and
even the URL friendly pages and category pages.

For example www.mywebsite.co.uk/articles/test-article gives me a 404 error.
If I switch back to Default URL settings then it works (www.mywebsite.co.uk/articles/?p=1).

Please help, I need to get the SEO friendly URLs working!

Here is what I am using:
1. Apache2.2
2. Tomcat 5.5
3. MySQL 5.1.55
4. jdk1.6.0_24
5. Windows Server 2003
6. WordPress Version 3.2.1
7. Quercus 4.0.18

Virtual host added in the httpd.conf file

<VirtualHost *:80>
ServerName www.mywebsite.co.uk
ServerAdmin info@mywebsite.co.uk
LogLevel error
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.mywebsite\.co.uk
RewriteRule ^(.*)$ http://www.mywebsite.co.uk$1 [R=permanent,L]
JkMount /* ajp13
JkMount /*.jsp ajp13
JkMount /*.css ajp13
JkMount /*.jpg ajp13
JkMount /*.gif ajp13
JkMount /*.js ajp13

.htaccess file created under the "articles" folder (the wordpress application)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /articles/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /articles/index.php [L]
# END WordPress

Quercus Servlet and Tuckey's UrlRewriteFilter declared in the web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="mywebsite" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">



<servlet-name>Quercus Servlet</servlet-name>

Specifies the encoding Quercus should use to read in PHP scripts.

Tells Quercus to use the following JDBC database and to ignore the
arguments of mysql_connect().


Location of the license to enable php to java compilation.

<servlet-name>Quercus Servlet</servlet-name>




12-17-2013, 07:04 PM
Hi Sam,

I am in a similar situation: Wordpress seems to work fine in my Quercus instance but only until I change the permalink structure to a non-default (i.e. pretty) structure. Then I get 404 errors when I try to go to a page like /sample-post/

If you have found a solution I would love to hear about it. Thanks.