Generating sitemap.xml on multi stores - magento

I have setup multistores on one Magento installation and all the stores are on different servers. I have created symlinks for each of them.
Now I want to generate sitemap.xml for each store. I have created a folder called sitemaps on my root directory, inside sitemaps I’ve created folders for each store. (i.e. store1, store2 inside sitemaps). Now I’m generating sitemap.xml inside them folders for each store. I’ve also add the following line in .htaccess of store1.com:
RewriteRule ^sitemap.xml$ http://www.mainserver.com/sitemaps/store1/sitemap.xml [NC]
(found this help here: http://www.magentocommerce.com/boards/viewthread/59388/)
Now if I type www.store1.com/sitemap.xml, I should be able to see the xml for that store but I’m getting 404 Not Found error.
Any ideas?

Copied from Magento stack
NOTE: I tried this way it always works.
First, create a new folder called sitemaps in the root of your website, then create subfolders for each domain.
/sitemaps/domain_1/
/sitemaps/domain_2/
Then login to the Magento admin and navigate to – catatlog -> google sitemap
Create or edit the sitemap listings for each store and set the “path to sitemap” field to be the path you created for the store.
/sitemaps/domain_1/
/sitemaps/domain_2/
Update your robots.txt file. To make sure that the search engine spiders are properly directed to the new sitemaps. You may need to update or create the robots.txt file. Edit the robots.txt file and add the following lines at the top —
# Website Sitemap
Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
Finally, if your site uses the Apache web server engine, you should update the .htaccess file in the root of your website to direct any other sitemap requests to the proper place.
Locate the following line below the line that reads — RewriteEngine on
And add the following redirect statements below it —
# Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_1\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_1/sitemap.xml [NC,L,R=301]
# Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_2\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_2/sitemap.xml [NC,L,R=301]

Related

can magento add store with different subdomain?

it's my first time to use magento
my main domain for exmple domain .com with centos OS
my magento on store.domain .com with Ubuntu 16
can i use the same Ubuntu server for another store with sub domain store2.domain .com ?
P.S my main domain domain .com uses wordpress Cms
thanks
Yes. You Can add store with different subdomain. Follow below steps:
Go to admin then select tab System->manage stores
Click create store view and complete the form and save store view
Change the Base URL for each Store view
1.Go to admin then select tab System->configuration
2.On the left side of the page General under that select web but before that you have to change the Current Configuration Scope to your store view name
3.Edit the base url to you subdomain(eg: http://en.yourdomain.com)
4.click save config.
Change .htaccess for redirecting to store view if you call the subdomain
1.Your .htaccess file is at the root folder of magento.
2.Search for "RewriteEngine on" word in .htaccess file and write the code below it
RewriteCond %{HTTP_HOST} ^en.yourdomain.com
RewriteRule ^ - [E=MAGE_RUN_CODE:english]
RewriteCond %{HTTP_HOST} ^fr. yourdomain .com
RewriteRule ^ - [E=MAGE_RUN_CODE:french]
then save the .htaccess file and try to clear all cache and browsing history from your browser as well as from magento.

laravel external folder definition

My folders structure like this: app, bootstrap, public, vendor
But, I want to create another folder in there and put some php files (irrelevant with laravel).
For example wordpress.
i.e.
I have a web site with laravel and I want a wordpress blog in subfolder to.
I created folder names like "blog". But when I access domain.com/blog laravel presents an error.
I need to tell laravel, blog folder is not yours.
How can I do that?
I made like this:
RewriteEngine On
RewriteCond $1 !^(chat)
and it's work
RewriteEngine On
RewriteRule ^(blog)($|/) - [L]

Joomla 2.5: How to remove the parent category from URLs?

I'm trying to migrate my Web site from Joomla 1.5 to Joomla 2.5. After running RedMigrator I've got all articles imported in my new Web site. The URL of Joomla 2.5 articles is however different from the original one. In particular I'd like to get rid from the URL of the parent category so that it looks like
host/category/article
instead of:
host/parent-category/category/article
Is there any way to do it from the configuration or do I have to use mod_rewrite to get my URL rewrited by Apache ?
Thanks!
In my experience there's no way to do this without third-party extensions, though you might experiement with creating a hidden menu containing an item for the sub-category's blog layout.
Simply remove a url segment with .htaccess
In your .htaccess file:
RewriteEngine on
RewriteBase /
RewriteRule ^/parent-category/(.+)$ /$1 [L,QSA]

how to redirect a link in my website to an external link?

I have provided a link from my web site in my andoird app which is:
www.mysite.com/support
And i want this link to be redirected to:
www.anothersite.com
i have already tried com_redirect and entered support as source and http://ww.anothersite.com but i dont get any redirects and i get 404 error.
I am running Joomla 3.x and i want to know how i can do this with URL rewrites and no external components.
It seems not possible to do it within the Joomla backend (i tried many combination of menu items and the redirect module).
For sure you can write your redirect directly in your .htaccess (if you are using it) like this:
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^support/?$ http://www.anothersite.com/ [R=301,NC,L] # Permanent Move
or
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^support/?$ http://www.anothersite.com [R,NC,L] # Temporary Move
More info about URL rewriting and .htaccess are here: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

creating admin folder inside CodeIgniter App

I have the front end fully working in a codeIgniter application. Now, I have to create admin as well. So, How would I create the admin section creating a new directory. Without interrupting codeigniter directory structure.
localhost/myapp/admin
CodeIgniter already supports 1 subfolder level within the controllers folder. So within /applications/controllers/ you can just add /applications/controllers/admin/ and it will work fine.
you could omit it out via .htaccess so that the directory actually works like a directory rather than how its initially developed to work.
RewriteEngine on
RewriteCond $1 !^(index\.php|admin|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
what this does is turn on apache modrewrite then tells apache any calls to index.php, robots.txt or yourdomain.com/admin/ (and any sub-folders/files within) treat as you would normally without codeigniter mucking up the works. Also this will remove the required index.php from the URL you will be able to link to your site like
mydomain.com/home/
instead of mydomain.com/index.php/home/
There's an explanation about that in CI User Guide: Managing your Applications

Resources