Using WPML wordpress with Multilingual laravel application as subfolder - php

I have a multilingual laravel application. My url structure like that:
https://example.com/en/paths
https://example.com/es/paths
I installed wordpress in /public/blog. It is working successfully.
I also installed WPML plugin in wordpress then url structure was like this,
https://example.com/blog/en/blog-paths
https://example.com/blog/es/blog-paths
So my first URL structure is broken. This is a situation I would not prefer for SEO.
Any advice on how to install wordpress inside Laravel application, keeping the multilingual url structure?
I want to result url structure like this instead of above schemes,
https://example.com/en/blog/blog-paths
https://example.com/es/blog/blog-paths

I'd try to install Wordpress inside public folder of your Laravel app that is in charge of responding to example.com via app/public/index.php
Thus, every request to app/public/blog/ will be handled by WordPress.
Imho, this setup save your current url structure and do not interfere in any way.
Probably you have to adjust your Nginx config, but that is another question.

Related

Completely move from Joomla to Wordpress using same domain and server

I'm trying to move my site from Joomla to Wordpress. I'm not a developer and I'm not that well versed with Joomla. I've already recreated the entire site in Wordpress and I don't care too much about SEO. I've had a look at the migration plugin in WP but it's not doing what I need it to do.
Currently, my Joomla site address is: http://myfakesite.com/index.php?lang=en. My WP site resides at http://myfakesite.com/wp/
I've already tried the redirection option from within Joomla but it's not working.
I intend to completely remove Joomla from my server and its database too. How should I proceed?
Use WP all import free plugin by Soflyy.
Its very good way for transfer data with true format,
For first you must export all Joomla data in XML file,
I think its easy. You can find plugin from this link

Install magento into an existing wordpress site

I have a wordpress site online and I'd like to integrate Magento into my existing site.
Okay so I want to
Download the Magento files
Setup my Apache configuration, for this I already have my site configuration, so I was thinking about putting magento in this url mysite.com/my-store/ ... but for this on apache should I use "location" directive?
What else do I need to consider?
The best way to go about is install Magento in new folder and create new database as Magento requires a lot of resources and you don't want get it mixed.
It all depends what exactly is that you planning to achieve. Either to use your domain name as a main ecommerce and setup the Wordpress as a directory
domain-name.com/blog
if it's a blog or something, or you can setup an alias that points to the folder and have something like this:
store.domain-name.com
Another way to do it if you would like to have everything integrated is to use FishPig Extension and then simply update all the WordPress plugins and point it to your existing database.
these are two seperate programs so best would be to get a plugin for wordpress and integrate magento inside there are a few plugins like this out there http://www.mwi-plugin.com/

Gradual Wordpress to Laravel migration

We have a Wordpress website currently working and want to migrate to Laravel 5. For some reasons we want the website to be moved part-by-part. Every newly redesigned page will be implemented by Laravel and old pages still remain on Wordpress.
I want if there is a route registered for current URL in Laravel, then load it from Laravel, else let Wordpress to load it.
We don't want to have any /wordpress/ in URL. Also the administrations panel should still be accessed using /wp-admin url without any prefix.
Is there any clear solution for this?
Actually the solution exists. Recently, I managed to migrate my Wordpress site to Laravel "gradually". At first, I "combine" Laravel to use WP database using Corcel package. And the routes were still handled by WP, which Laravel just catch the full URL request and passed it to controller like this:
Route::get('/{ids}', 'UrlController#withIds')->where('ids', '^(?!admin).*');
where the {ids} was just passed to WP's get_page_by_path($id); function and returned the data to the blade template.

Exposing a web service through WordPress

I'm creating a new plugin for WordPress that requires an outside website to use a web service. For instance, if there are two sites, A and B, the plugin will be installed on A with all associated data stored in the WordPress database for Site A. Site B will use the web service to grab data in XML format from Site A.
Is this possible? What would be the most secure way of pulling this off?
I could just have the web service as a PHP file in my plugin, but that's going to require the outside domain to hit something like:
http://www.example.com/wp-content/plugins/plugin-folder/web-service.php. It seems like a bad idea to expose the level of depth of the WordPress setup.
I could have my plugin create a few files in the root so that the web service call would be to http://www.example.com/web-service.php, but having my plugin install stuff outside of the plugin directory also seems like a bad practice.
Another thought: Could I put the file in my plugin folder, but add a line in file .htaccess to make http://www.example.com/web-service.php go to it?
What is the best, most secure way to go about this?
I would set up a rewrite rule in .htaccess to let the user get to your code without knowing where it is. I don't think there is an easy way to add specific routes to the WordPress front controller, but you could see if there is an action or filter to do that.
Here's a post on adding routes: How can I create custom URL routes?
In my personal opinion, if I installed a WP plugin and you created a new file in my root directory, I would either delete the file or the plugin all together. I would also try to avoid adding a .htaccess file. This would again make me suspicious.
What I would do is, upon install ping a file on Site B (your site) that captures the location of the plugin folder on Site A (their site), because WP might be installed inside of a directory and not at the root. Then you know where the "web-service.php" file is located. Then you can just hit that file whenever you need. There is no reason for .htaccess rules, or creation of new files.
Just a suggestion :)

Wordpress Network per site Custom URL Slugs

I'm attempting to setup a Multisite Wordpress Network, but one of the requirements is that each site needs to have their own custom slug in the URL. For example:
http://www.site1.com/blog/
http://www.site2.com/reviews/
http://www.site3.com/commentary/
Currently, so far as I can tell, there is no way of tailoring a per site slug. Domain Mapping is simple using the plugin Wordpress MU Domain Mapping (It's compatible with Wordpress 3+ Networks.) But what I really need is the added ability of those custom slugs. Has anyone seen anything of that sort?
I'll revert to a large collection of individual Wordpress Instances if I have to, but this network setup would be the perfect solution if I could get the slugs to work.
The slugs have nothing to do with your multisite setup. Look into modifying each site's permalink structure instead.
UPDATE
Maybe try to write your own rewrite rules?
The resulting research is that you can't do what I was after with the default build of Wordpress using the Multisite features and the Wordpress MU Domain Mapping.
The arrangement can work sub-directory separation of sites, but the only way to allow the sub-directory to exist for domain mapped addresses is to build an entirely new plugin that does the domain mapping with support for that, or to modify the Wordpress MU Domain Mapping plugin so that it has the support for it, effectively creating a new plugin out of it.

Categories