Käynnissä

mod_rewrite problem - wordpress & cake php

I have a small problem that is driving me nuts. I think it will be pretty simple for the right person to solve.

I am trying to make cakephp and wordpress (also php) live together on a single domain e.g. [url removed, login to view]

The proglem is I cannot get the right mod_rewrite rules to make it work nicely. they both also want to have the an [url removed, login to view] in the same directory which is also causing problems.

Here is my cake .htaccess

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ [url removed, login to view]$1 [QSA,L]

</IfModule>

and here is wordpress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /blog/

AddDefaultCharset UTF-8

RewriteCond %{REQUEST_URI} !^.*[^/]$

RewriteCond %{REQUEST_URI} !^.*//.*$

RewriteCond %{REQUEST_METHOD} !=POST

RewriteCond %{QUERY_STRING} !.*=.*

RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$

RewriteCond %{HTTP:Accept-Encoding} gzip

RewriteCond %{DOCUMENT_ROOT}/home/webapps/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/[url removed, login to view] -f

RewriteRule ^(.*) /home/webapps/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/[url removed, login to view] [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$

RewriteCond %{REQUEST_URI} !^.*//.*$

RewriteCond %{REQUEST_METHOD} !=POST

RewriteCond %{QUERY_STRING} !.*=.*

RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$

RewriteCond %{DOCUMENT_ROOT}/home/webapps/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/[url removed, login to view] -f

RewriteRule ^(.*) /home/webapps/wordpress/wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/[url removed, login to view] [L]

</IfModule>

# END WPSuperCache

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /blog/[url removed, login to view] [L]

</IfModule>

there are only a small number of controllers that I need to get to the cake app e.g. keywords, users, reports, and they are distinct from the slugs used by wordpress.

Please can someone provide for me a working .htaccess file or explain what I need to do to fix.

thanks

Michael

and

Taidot: Linux, Perl, PHP, Järjestelmänvalvoja

Näytä lisää: cake rewrite, rewritecond http_host, rewritecond request_uri, wordpress cakephp, cakephp mod_rewrite, cake htaccess, cakephp wordpress directory, rewritecond cakephp, cakephp wordpress htaccess, request_uri mod_rewrite, cakephp rewrite working, php request_uri mod_rewrite, rewritecond http_host request_uri, mod rewrite rules updated super cache, php request_uri rewrite, rewritecond cake, mod_rewrite php request_uri, cakephp wordpress cookie, mod_rewrite wordpress, wordpress amp, wp content wordpress, work from home rules, wordpress wp, wordpress l, wordpress e com

Tietoa työnantajasta:
( 116 arvostelua ) London, United Kingdom

Projektin tunnus: #402883

Myönnetty käyttäjälle:

jocu

Hello, I've got thorough experience with mod_rewrite and with WordPress, I can help you to fix this problem quickly.

30 $ USD 1 päivässä
(7 arvostelua)
3.2

2 freelancers are bidding on average $40 for this job

Pektsekye

you should change the script to make the wordpress urls to differ from the cake php urls. Then you can use this difference to make the htaccess work

50 $ USD 2 päivässä
(106 arvostelua)
5.6