Setting 301 redirect for index.html page

Our client wants to have 301 redirect for index.html page.
So http://www.website.com/products/index.html will be redirected to http://www.website.com/products/
To achieve this, make sure Apache’s Rewrite module is enabled and then add the following line in /etc/httpd/conf/httpd.conf:

RewriteRule ^/products/index\.html$ /products/ [R=301]

Run /sbin/service httpd reload for it to make effect

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s