In the company where I work we used to have Wordpress on its own subdomain, like blog.ourwebsite.com. We decided that it would've been better to have it in the main domain, like: ourwebsite.com/blog. Also, we want it perfectly integrate with our current design, so the blog should load inside the website showing just the posts, while the header and the footer will be the one of our website. Our website is built with Codeigniter.
I've read different articles and questions about how to integrate the two platforms and in the end we opted for putting Wordpress inside the root directory of the Codeigniter installation, so that it looks like this:
ourwebsite/
application/
system/
wordpress_blog/
In the Codeigniter index.php I am loading Wordpress with this instruction:
require_once './wpblog/wp-blog-header.php';
I put it on top, so before loading the codeigniter core. At this point the only problem was the site_url function conflict which I solved by renaming it in Codeigniter. So, everything seems to work fine except that I have no idea how to access the Wordpress administration panel.
I then created a blog controller and I can now call Wordpress functions inside the Codeigniter view. So at this point the Wordpress content is displayed correctly. The problem is that I have no idea how to access the Wordpress admin panel. If I try to access localhost/ourwebsite/en/blog/wp-admin I, of course, get an error, because it's trying to access a wp-admin function inside the controller, which doesn't exist. So I was thinking to access directly the directory with something like localhost/ourwebsite/wordpress_blog/wp-admin (wordpress_blog is the name of the directory on disk, which is different from the controller name), but I get a 404 error. I also added this directory to the Codeigniter .htaccess file that now looks like this:
RewriteEngine on
RewriteBase /ourwebsite/
RewriteCond $1 !^(index\.php|wordpress_blog|cache|captcha|fonts|forum|media|img|min|css|js|scripts|images|uploads|docs|robots.txt|sitemap.xml|sitemap|public|tools|assets|xd_receiver.htm)
RewriteRule ^(.*)$ index.php/$1 [L]
Any idea?
EDIT:
I tried accessing directly the wp-login.php file, at http://localhost/~carlo/ourwebsite/wordpress_blog/wp-login.php. This actually works. The thing is that when I try to login it redirects me to a wrong url, which is: http://localhost/~carlo/ourwebsite/wordpress_blog/wp-admin/localhost/~carlo/ourwebsite/wordpress_blog/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2F~carlo%2Fourwebsite%2Fwpblog%2Fwp-admin%2F&reauth=1.
The thing is that it logged me in anyway, so if I try to access the admin panel again, now, it kind of works. I can see it but it's like it has no css or javascript files loaded.
ok then try to change the wordpress siteurl in option table. it should be like localhost/ourwebsite/wordpress_blog/..
and check your
localhost/ourwebsite/wordpress_blog/wp-admin
edited 2/11/2014
define('WP_HOME','http://localhost/~carlo/ourwebsite/wordpress_blog/');
define('WP_SITEURL','http://localhost/~carlo/ourwebsite/wordpress_blog/');
you are missing "http://"
Related
I'm very new to drupal and don't know anything about it. I'm, using OpenServer witha PHP 7.4, Apache 2.4, MySQL 5.7. I'v estracted everything into c/OsPanel/domains/cms/Drupal/freshmart/ (I have installed wordpress in c/OsPanel/domains/cms/WP/restaurant and everything works as it should. When I go to cms/drupal/freshmart, I have login page, I login and go to welcome page. When I try to acces anything else like structure, appearance and etc, I get "Page not found" and url is cms/drupal/freshmart/admin/content. In folders, there is no such folder as admin, but from what I know there shouldn't be it.
If you are using a temporary URL such as 192.168.0.42/~username because the domain has not been transferred yet or has not propagated yet, you would have the problem described above until the domain name is transferred over.
To be able to use Drupal before the domain name points over, you will need to change something in the .htaccess file:
Modify the RewriteBase if you are using Drupal in a subdirectory or in a
VirtualDocumentRoot and the rewrite rules are not working properly.
For example if your site is at http://example.com/drupal uncomment and
modify the following line:
RewriteBase /drupal
If your temporary URL is something like 192.168.0.42/~username then you will need to add the following line in .htaccess:
RewriteBase /~username
Once you point the domain name over to the website, be sure to comment out or delete that line.
I saw this on one of the forums, and I think it could be my problem. But I don't understand what should I write in RewriteBase/.
On server mod_rewrite is enabled, there is a .htaccess. What should I do?
I have Wordpress multisite installed at the root of my site (the Wordpress files are actually in /wp, but it's configured so that each subsite URL is at the root - eg. /site1, /site2 etc.) This means that there's a Wordpress section in my .htaccess file that I probably shouldn't be touching, because Wordpress might overwrite those changes.
However! There is a redirect I would like to build, from (say) /path/to/oldsite to :8080/newsite, and I don't know how to do this without RewriteEngine. Other redirects I have managed to do basic 301s with, but I don't know how to redirect to a different port that way. My test attempt to have multiple sections that use RewriteEngine didn't work since apparently only the final RewriteEngine section gets heeded?
Anyway, that's my issue. Any suggestions for the best way of building this redirect? Am I just going to have to create empty directory /path/to/oldsite to put a redirect in?
Thanks!
As a process of white labeling WordPress websites for my clients I was wondering if I can mask admin panel URLs from these:
https://www.somerandomaddress.com/wp-admin/index.php
https://www.somerandomaddress.com/wp-admin/post.php?post=12&action=edit
to these:
https://www.somerandomaddress.com/admin/index.php
https://www.somerandomaddress.com/admin/post.php?post=12&action=edit
Preferably I don't want to change core WordPress code so official WordPress updates can be applied without any problem.
You need to modify your .htaccess in order to wp work as before and see the url only changed.
Try this:
RewriteRule ^wp-admin/(.*)$ /admin/$1 [QSA,L]
For that you can use the plugin
Protect Your Admin
I moved a Wordpress site to a new server. The site is installed in a subdirectory and the .htaccess in the root forwards to it like so:
RewriteEngine On
RewriteCond $1 !(^wpfolder/)
RewriteRule ^(.*)$ wpfolder/$1 [L]
I've changed the site_url and home entries in the wp_options table in the database. Everything is working fine - except if I visit site.com/wp-admin to login - it redirects to the login page like so:
site.com/wp-login.php?redirect_to=http%3A%2F%2Fsite.com%2Fwpfolder%2Fwp-admin%2F&reauth=1
(notice the 'wpfolder' in the redirect_to value)
When I enter the correct username and password, nothing happens and I get the login box again. I can log in no problem by visiting site.com/wp-login.php - but I'd really like to solve this redirect problem if possible.
I found a solution that worked for me. Update the site url to site.com/wpfolder
if you are having problems doing that, you can put define('RELOCATE',true); on you wp-config.php file and it would do it for you. The admin and login links will be site.com/wpfolder/wp-admin but on the site itself the url are all relative to the root (site.com/about) and I think it is the correct behavior of this configuration
Hope it help
This problem often occurs when moving WordPress.
I use a plugin called duplicator when moving sites. It's great for moving test sites to their live server and much more.
Just search Duplicator inside the plugins section of the back end.
https://wordpress.org/plugins/duplicator/
The plugin takes all files and also the database as a backup for you to install on a new server or even just move to a different directory.
When you have downloaded the files duplicator provides you can upload installer.php and backup.zip to the new server or directory.
Run installer.php and enter the new database and website details in the prompts.
Let the plugin do it's stuff.
After it is complete there will be no problems with any area of the site.
Although it seems like a long process it rarely takes more than 5 minutes depending on how many files the WordPress build contains.
I've a Joomla site but I want to move it to Drupal-6 site. How should I go about changing existing url's? Should I add the redirection in .htacces or use any redirect modules?
One main reason of moving is the forum module in Drupal which I'd like to use.
I'd be using nodealias & global redirect modules.
In my site I'm using SH404SEF to generate urls(with .html suffix).
You can absolutely place a redirect in the .htaccess file and reference the pathauto generated path.
http://drupal.org/project/pathauto generates URL aliases based on title etc. and then put something like:
RewriteRule ^misc/about.html http://www.example.com/aboutus/ [R=301,L]
for each URL. (This is better off in your apache httpd.conf file for performance reasons.)
Or there is a module:
http://drupal.org/project/path_redirect
Which looks like it does just what you want but I've not tried it.