Rewrite with Joomla and WordPress

Topics: Developer Forum, User Forum
Jun 16, 2009 at 10:54 PM

Hey Everyone,

This is my first post to Codeplex.  I'musing the ISAPI rewrite module on my Windows server to rewrite the URL's for Joomla!  After some time, I got it work great!  I have now since installed WordPress inside /blog directory in my Joomla! directory.  When I turn on permalinks in WordPress, I get a 404 error.  I can't seem to find the write syntax to get both Joomla! and WordPress to work with SEF URLs.

Any body have some suggestions? Tips?

Thanks -

Jul 6, 2009 at 8:11 PM

what have you tried?  Ini file for IIRF?  Log file?  Are there specific problems you can report?

Jul 6, 2009 at 8:37 PM

I am currently using the ini file for IIRF.  I've tried a couple of examples online, but nothing has worked the way it should.

I can't seem to get WordPress to work on a windows box using permalinks.  I always get redirected to a 404 page.

Jul 6, 2009 at 11:42 PM

"The ini file for IIRF" is something that you are expected to customize.   So when you say "I am currently using the ini file for IIRF" - I don't know what that means.  My question was, what's in your INI file?

I understand that you cannot get it to work, and that you are getting 404's.  In order to diagnose it I need some additional information.   What's in your ini file?  What's in your log file? What URLs have you submitted?

Jul 20, 2009 at 9:50 PM

Here's what's in my INI file:

# Joomla Rewrite rule

# This ruleset says, if the URL ends in .htm, .php, or .html (case
# insensitive); AND the physical path associated to the URL is not
# a file AND it is not a directory, then rewrite the URL to
# index.aspx, and parse no more rules.

RewriteCond %{HTTP_URL} (/|\.htm|\.php|\.html|/[^.]*)$ [I]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# (?!____) is a negative look-ahead.
# If it matches then the rule is skipped
# Below we are skipping /store/, /portal/, and /forms/ subdirectories
# (?!^/store/.*)(?!^/portal/)(?!^/forms/)
# I don't think we actually need this because the RewriteCond rules above
# will automatically bypass anything we care about anyway.

RewriteRule (.*) /index.php [I,U,L]

#WordPress Rewrite Rules
#RewriteRule ^/(?!index.php)(?!wp-)(.*)$ /index.php/$1


Jul 20, 2009 at 10:43 PM

Ok, that;s a good step.  You didn't answer any of my other questions, but without knowing anything else, I can see that this is a pretty simple ruleset.

It does one thing - rewrites EVERY url to /index.php, if:

  •  the URL ends in one of these things: /, .htm, .html, .php or a slash followed by a sequence of characters that is not a dot.
  • AND the REQUEST_FILENAME is not the name of a file
  • AND the REQUEST_FILENAME is not the name of a directory

I don't know if that is what you want, but that is what you have.

Now... about the other questions I asked.  do you have answers for those, too?

What's in your log file?

what URLs have you submitted?

how were they rewritten?

how did you expect them to be rewritten?

Listen I know you;re having problems, and I'm sorry about that.  I'd like to help.  But I am not clairvoyant.  I don't know the problems you're having.  If you want help, you have to describe the problems in greater detail than... "it doesn't work."