0

I have a multidomain magento setup, Says abc.com and xyz.com .

I want to write a redirect rule for xyz.com only in the root .htaccess file. When i write a rule what it does, it redirects all urls from abc.com also to xyz.com and 404.

Basically i need to redirect all .html url's from xyz.com only to without .html . I am using :

RedirectMatch 301 (.*)\.html$ http://www.xyz.com$1
DRAJI
  • 1,829
  • 8
  • 26
  • 45
Afroz Alam
  • 874
  • 6
  • 19
  • I want for example xyz.com/categoryurl.html redirect to xyz.com/categoryurl (.html to without html for all urls on xyz.com only. It shouldnot affect abc.com which is configured on same magento instance) – Afroz Alam Mar 28 '14 at 06:22
  • to remove .html at the end of the url in xyz.com? – DRAJI Mar 28 '14 at 06:37

1 Answers1

0

You can remove that .html at the end of the url by following below steps

System -> configuration -> catalog -> Search Engine Optimizations

Here you can find 2 attributes named as "Product URL Suffix" and "Category URL Suffix". Just empty those fields in XYZ.com store

enter image description here

EDIT

   <IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*).html\ HTTP/
   RewriteRule .* http://urdomain/html/%1 [R=301,L]

   RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*)\ HTTP/
   RewriteRule .* %1.html [L]
   </IfModule>

refer this following url,

How to remove .html from URL

here you can get the solutions

UPDATE

I'm Not sure. But I hope, It may help you

RewriteCond %{REQUEST_URI} xyz[NC]

RewriteRule ^(.*)\.html$ /$1 [L,R=301] 
Community
  • 1
  • 1
DRAJI
  • 1,829
  • 8
  • 26
  • 45
  • I donot want to remove .html from url but only redirect .html to without .html as all urls are already cached in google with .html – Afroz Alam Mar 28 '14 at 06:49
  • Also issue is that the "Product URL Suffix" and "Category URL Suffix" is setup with ".html" for all stores but for xyz.com in frontend the urls are showing without .html and if i open any url with .html(from google searches) it gives 404. So approx 5000 google cached urls with .html giving 404. I want to redirect them to without .html to avoid 404. – Afroz Alam Mar 28 '14 at 06:52
  • Thanks for the link. I didnot found my answer there. But you can see in my question itself , i have the solution but the issue is that my Magento is mulidomain. Applying that rule applies for all domains. I want that the rule only should apply to xyz.com. – Afroz Alam Mar 28 '14 at 07:06
  • don't you have separate .htaccess for both domains? – DRAJI Mar 28 '14 at 07:08
  • No there is only one htaccess as there is one magento installation. – Afroz Alam Mar 28 '14 at 07:15
  • You must create another .htacccess file for that store and map that domain with this .htaccess file – DRAJI Mar 28 '14 at 07:20