Conflicting Friendly URLs with WordPress and IPB3

New to mod_rewrite? This is a good place to start.

Conflicting Friendly URLs with WordPress and IPB3

Postby DavidT » Tue Jul 07, 2009 12:01 am

I've just set up a WordPress blog and IPB3 forum on a new site, and I am having issues getting friendly URLs to play nice with each other.

Blog: www.domain.com
Forum: www.domain.com/talk

The problem is that whenever I navigate anywhere on the forums, besides the index, I get sent to a WordPress 404 page.

So "www.domain.com/talk" works, but "www.domain.com/talk/anything-here" doesn't.

Here's my .htaccess:

Code: Select all
# BEGIN WordPress Friendly URL
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# End WordPress Friendly URL

# BEGIN IPB3 Friendly URL
Options -MultiViews
RewriteEngine On
RewriteBase /talk/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule . /talk/index.php [L]
# END IPB3 Friendly URL


And my WordPress Friendly URL structure is /%category%/%post_id%-%postname%

Any help with this would be greatly appreciated :)

Thanks in advance.

(As you can tell from the code, I am entirely new to this and am quite stumped. The code is probably a complete mess and I'm guessing I don't need the duplicate lines, but I don't know how to re-write it.)
DavidT
 
Posts: 2
Joined: Mon Jul 06, 2009 11:42 pm

Postby richardk » Tue Jul 07, 2009 8:54 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# BEGIN IPB3 Friendly URL
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\..+$
RewriteRule ^talk/.+$ /talk/index.php [L]
# END IPB3 Friendly URL

# BEGIN WordPress Friendly URL
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . /index.php [L]
# End WordPress Friendly URL
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby DavidT » Tue Jul 07, 2009 9:29 am

That worked perfectly Richard, thanks! :D
DavidT
 
Posts: 2
Joined: Mon Jul 06, 2009 11:42 pm

1 domain, 2 apps

Postby alexone » Mon Jul 13, 2009 11:04 am

Hi there, I didn't found any post more related to my problem and I can't create new topis so I'm asking here.
After couple of hours digging I'm really happy that I've found this forum :)

I have 1 domain and 2 apps wordpress and rails app. Both handled by apache (mod_php and passenger). Directories structure is

apps
|_ wordpress
| |...
|_ rails_app
| |_public
| |...

What I'd like to achieve is to have this 2 apps under 1 domain.
I've prepared a couple of static pages in wordpress:
www.example.com/contact
www.example.com/faq
www.example.com/terms
My blog articles are published on www.example.com/blog/...
Any other url (for example www.example.com/login, www.example.com/products etc.) should be served by rails_app.

Is it possible to have both apps under this 1 domain? and serve one or another based on url? If yes, how should rewrite rules look like?

I would appreciate any help :)
Regards
alexone
 
Posts: 1
Joined: Mon Jul 13, 2009 10:44 am

Postby richardk » Wed Jul 15, 2009 12:46 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# BEGIN WordPress Friendly URL
RewriteRule ^(contact|faq|terms)$ /blog/index.php [L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^blog(/.*)?$ /blog/index.php [L]
# END WordPress Friendly URL

# BEGIN Rails App.
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule . /_ rails_app/ [L]
# END Rails App.


You will probably need to change the path to the rails app. controller (/_ rails_app/).
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 104 guests

cron