Spatie Sitemap not generating URLs on localhost - laravel

I am creating a website in Laravel 5.8 and using Spatie sitemap package to create Sitemap dynamically, It doesn't crawl my website and only generates homepage URL.
Route::get('/sitemap',function(){
SitemapGenerator::create( 'http://localhost/' )->writeToFile('sitemap.xml');
})->name('sitemap-generator');
Note: But when I map website with a virtual host, It is working properly.
Route::get('/sitemap',function(){
SitemapGenerator::create( 'http://local.project.com/' )->writeToFile('sitemap.xml');
})->name('sitemap-generator');
Any help will be appreciated.

You have to use port with localhost. In my case port was 8000.
SitemapGenerator::create('http://localhost:8000')
->writeToFile(public_path('sitemap.xml'));
This worked for me.

Related

Laravel and Wordpress routes and directories

I'm working on a new Laravel + Wordpress project and I would like these to be the URLs of each part of the site:
example.com: App made with Laravel
example.com/blog: Wordpress blog
example.com/store: Online store made with WooCommerce (Wordpress)
example.com/whatever: Other pages of the Laravel app
And finally, I would like both blog and store to be the same instance of Wordpress avoiding having two separated Wordpress installations. How should I deal with directories and htaccess configurations in order to get what I need?
Thank you!
Check this articles
https://wpengine.com/resources/wordpress-laravel/
https://www.cloudways.com/blog/integrate-laravel-and-wordpress/
https://vegibit.com/how-to-add-a-wordpress-blog-to-your-laravel-application/
https://medium.com/m/global-identity?redirectUrl=https%3A%2F%2Fblog.devgenius.io%2Fwhy-when-and-how-to-develop-wordpress-with-laravel-features-live-examples-f7958cf1b7ea
https://medium.com/#Madgeek_in/how-to-install-a-wordpress-blog-to-your-laravel-web-application-24e79036ce77
and this question
Integrate Laravel into Wordpress
and this package
https://github.com/ekino/EkinoWordpressBundle

How can I deploy Laravel and Wordpress together on Laravel Forge?

We are trying hard to deploy Laravel website with Wordpress on Laravel Forge but are unable to do so.
Say, if our domain is example.com, the blog should be example.com/blog. However, what we currently have is blog.example.com, which is not serving the purpose.
It'd be great if someone can help us find a fix for deploying Laravel project with Wordpress on Laravel Forge without changing the URL structure.

Configuring Laravel project in DirectAdmin server

I'm a newbie to Laravel projects but I need to have one accessible over the internet so I tried using DirectAdmin but whenever I go to my domain I get an index (pictures attached).
I renamed the Laravel 'public' folder to 'public_html', is that correct? Here is my file structure.
Here is what I get when I go to my assigned domain which isn't my website at all.
The webpage should look something like this
I also found a laravel app using Softaculous linked here (https://panel.freehosting.com:2222/CMD_PLUGINS/softaculous/index.raw?act=software&soft=419). Am I required to use this app?
At first, you need to learn about the laravel directory structure. You don't need to change the laravel public folder to public_html. I am not sure how the DirectAdmin server works. but if you see a laravel directory instead of serving an application it's might be a path-related issue in your server. your domain should serve your application public folder.
I just found a tutorial for the DirectAdmin server with laravel. that might help.

error when accessing laravel project in ubuntu server 16.04

I have problem when i try to access my webapp in my ubuntu server 16.04..
when i try to type my server ip with the laravel folder it showing this message,
The requested URL /laravel_spk-matautama/home was not found on this server.
but then i try to put index.php on my link like this url
http://xxx.xxx.xxx.xxx/laravel_spk-matautama/index.php/home
it works, but the problem is it wont embed the masterpage layout.
Do like this, to access your home page
http://xxx.xxx.xxx.xxx/laravel_spk-matautama/public

Trouble accessing a custom form on magento(multiple website) from url

I created a custom web form for a magento website, on a local server which has only one website setup, i could access the form using the URL but when i upload the module to the server which has multiple website setup, i cannot access the form using the URl ,
for e.g on my local server i could access the form as
http://localhost/cars/index.php/surcontest-contest
but when i upload the module e.g dev.test.org on the server(it has multiple website setup, more than 50 sites ) i could not access the form
http://dev.test.org/surcontest-contest (gives me a 404 error)
how would i access the module, how would i find out about the url to access the form.
Any help will be greatly appreciated.
Thanking you in advance.
1) clean cache to make sure that module installed (check it in admin or database)
2) check that url rewrites enabled and works (can you access some category or product page without index.php ?)
If your default URL is http://www.test.org/ then to access multiple sub domain you should enable from your domain panel by providing host stetting
Hostname=*.test.org, address=, Record Type=A(address)
Also, on your server add sub domain dev.test.org.
It will create dev folder in the public_html folder in file manager.
You should copy index.php and .htaccess file in that follows the magento multiple web site steps see the link
http://inchoo.net/ecommerce/magento/how-to-set-multiple-websites-with-multiple-store-views-in-magento/

Resources