Installing Wordpress along side Cakephp - wordpress

I have cakephp installed in the root directory. site.com/
i want to install wordpress blog at site.com/blog
but since cakephp will redirect all urls i am not sure how to do it ?

From: http://dogmatic69.com/blog/development/7-using-other-apps-with-cakephp-htaccess-config
One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.
The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! running alongside cake with no issues when you have the .htaccess for Joomla! enabled. If the app does not have one and/or you would not know what to put in the .htaccess file you have another option
Make Apache stop processing rewrites if it finds a request for your sub directory. This is done by adding a rule for the sub directory and then telling Apache it is the last rule to process. The .htaccess file you want to edit is the one found inside your APP directory. All you want to add is the following line:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (some_folder/.*) $1 [L] # adjust the regex to what you want.
# normal cake rules
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
You can do this for as many sub folders as you wish, by changing the regex accordingly. Its pretty simple to do and a much cleaner way than having all your stuff inside the webroot/ folder of your APP.

Simply put the wordpress install into a "blog" folder in your /app/webroot folder.
Cake will load from the webroot as if the files were in a normal subfolder under a non-cake appliation. You may need to edit / adjust paths in the wp configs or .htaccess files throughout to get everything perfect but it isn't that difficult.

One way to do this is to have your domain pointing to site.com/cakefolder and then have another subdomain blog.site.com pointing to site.com/blog folder
This way to your user, it would always be site.com and blog.site.com

Related

Elgg with within subdirectory that is not executed by elgg

I have website that run elgg in root directory.
But I want into subdirectory that is located within elgg put wordpress site.
Example:
www.mysite.com - elgg,
www.mysite.com/wp - wordpress
Yes, and I don't need any kind of integration between them (no bridge)
Just to elgg not to execute this folder
So I need for directory www.mysite.com/wp different rules than for rest site.
I tried changing .htaccess file for www.mysite.com/wp directory, but I think it's wrong way.
It is working only for simple .php files, but wordpress is more complex and after long period of loading It show elgg "nothing found" site loaded.
Please don't ask change site structure, it is already set. And wordpress in subdirectory also has it's reasons.
I know there must be easy solution for this issue like elgg plugin for subdirectories, but problem is that web is flooded with topics about installing elgg in subdirectory and I can't find solution.
You can use a rewrite rule that uses ^$ to represent the root and rewrite that to your /wp directory, and write this just above index.php like this:
RewriteEngine On
RewriteRule ^wp(.*)$ /wp [L]
RewriteRule ^(.*)$ index.php?__elgg_uri=$1 [QSA,L]

Wordpress Install with other software installed in a subdirectory

I'm having an issue that I think can be solved with .htaccess, however, I'm not sure exactly how, htaccess rules have never been a strong point for me.
I have a domain with WHMCS installed on it, in a subdirectory, like this:
/websites/manage/
the /websites/ directory is otherwise empty.
Now, I have installed WordPress on the root of the domain, and I want to use the /websites/ location in the WordPress permalink structure, as I want to build a WordPress page that describes the products and services available there, and use it as a gateway to the WHMCS portal located beneath it.
I've tried searching for an answer to this problem, but I keep turning up tons of results about installing wordpress in a subdirectory, and nothing else.
Thanks for your help.
EDIT:
I should have mentioned:
Currently, I get the WHMCS portal when I go to /websites/manage/, which is fine.
However, my problem is that when I go /websites/ I get a directory listing instead of my WordPress page.
I solved this by adding the following to the beginning .htaccess file, before the WordPress section:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/websites/$
RewriteRule . /index.php
</IfModule>
This redirects the /websites/ directory to the /index.php file which WordPress can then use to find its matching page. It still allows the sub directory /websites/manage/ to be controlled by the WHMCS software residing there.

Removing Wordpress directory name from certain URLs using .htaccess

So I have one Wordpress install in a sub-directory. (www.mysite.com/wp/)
What I need is for certain pages to remove the WP directory name from the URL.
so 'www.mysite.com/wp/careers' needs to be -> 'www.mysite.com/careers'
I have an .htaccess in the root directory and in the wp directory. I've gotten some of my rules to work when permalinks are disabled in WP, but when those are enabled (which they need to be) the WP .htaccess overrides any rules I have in the root.
Is there any way to have 2 htaccess co-exist in this manner? Sorry I haven't messed with wordpress and apache very much.
Any input is greatly appreciated.
**So I finally got this working, it was just a matter of like you said formatting redirect URL so wordpress likes it.
So in my root htaccess file : for this url mysite.com/careers
RewriteRule ^careers/?$ wp/index.php?pagename=careers [L]
And voila and it started working just fine.
Yes, you can have rules in both htaccess files but it's going to be tricky as wordpress has specific ways that it will expect URLs to look.
In the wordpress htaccess file, above any wordpress related rules, add:
RewriteCond %{THE_REQUEST} \ /+wp/careers
RewriteRule ^ /careers [L,R]
then in the htaccess file in the document root add:
RewriteRule ^careers$ /wp/careers [L]
But again, depending on what wordpress expects the "careers" URL to look like, this may not solve your problem.

How to make a Symfony2 Bundle Live on a Website

Sorry if this is a dumb question, but I have been looking around for a bit with no luck finding an answer. I am new to Symfony2 and spent the last couple weeks installing it on my website's server, making a bundle and building all the pages, and testing it out with its app_dev.php urls. I'm now ready to make it public on my site, but I'm not sure how to go about doing this. Basically, I want to activate the bundles so instead of having to go to website/symfony/web/app_dev.php/Page, I can just go to website/Page. Thanks!
Ok, so thats not really a Symfony issues and it depends very much on your environment (mostly what webserver you are using). What you have to do is make the web folder of the symfony project your root folder (aka, where right now is the symfony folder) and move all other folder within symfony folder one level up. So lets say you have your httpdocs or www folder as your root folder, you have to copy the contents of symfony/web in that folder and move everything else from symfony folder one level above httpdocs folder. That being said, probably there is a lot more configuration that goes on into it. Here are a couple of resources to get you started:
http://symfony.com/doc/current/cookbook/deployment-tools.html
Symfony2: How to deploy in subdirectory (Apache)
Remember that in live mode you should be accessing app.php and not app_dev.php...
I tend to do it by adding those lines to an .htaccess file on the root:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/$1 [QSA,L]
</IfModule>
Then the original .htaccess file in the web directory takes care of the rest.

Static PHP application directory on a wordpress site

I'm having trouble setting up a directory with php files on a wordpress site.
I understand how to use templates to include a custom php file, but what I'm trying to do is access a php file as if wordpress was not installed. Right now when I create a new directory(dir1) and put an index.php file in that folder, then try to view by going to www.test.com/dir1 it shows a bulleted list with links to header, background, and updates with a text input for searching the website at the bottom.
I'm not sure if this is something that needs to be configure in my cPanel or if its a wordpress setting, or even if its an htaccess issue.
Please help me figure out what I need to do, or even at the very least, help me put into words what I'm trying to do. Thanks!
Usually Wordpress installed in the root has no impact at all on whatever is put into non-wp directories. Can you paste your .htaccess file from the root folder? And does your /dir1/ have any .htaccess?
Wordpress has nothing do to with existing folders/files. Here are some steps you may try.
Make sure your /dir1 doesn't have .htaccess or if in case you have and you need it to have it there, continue doing next steps.
Add some inclusions in rewrite engine of your .htaccess file. You may add something like this:
RewriteCond %{REQUEST_FILENAME} !-d and/or RewriteCond %{REQUEST_FILENAME} !-d
or
RewriteCond %{HTTP_HOST} !dir1
I hope this helps.
Bah, I've figured it out.
anytime I would FTP files onto my server, it would make the owner/group "root"
After I used WinSCP to change my users to match each website, it worked perfectly.
cPanel is a pain.

Resources