Unlock the Power of Exceptional Design with WebGate

In a digital landscape where first impressions are everything, WebGate stands out as a beacon of creativity and innovation. Elevate your online presence with our unparalleled Website UI+UX design services, meticulously crafted to captivate your audience and drive results.

Our Services:

  • Landing Page
  • Business Card Website
  • Multi-Page Site
  • Redesign
tire shop portfolio case translate services portfolio case
Share on Facebook Share on Twitter

How to glue index with homepage in .htaccess using 301 redirect?

How to glue index with homepage in .htaccess using 301 redirect? thumb

A very common mistake webmasters do, and not infrequently among optimizers is “clones” of the main page. As a rule, it is a domain with www and without, but even more often forget about gluing the main page with the url of the first document (index.html)

The changes we are going to talk about concern the .htaccess file.

As a result, it can be an obstacle to output on competitive and high frequently queries, and “smearing/spreading” weight value of the main page.

Glue /index.php and /:

# merging index.php with /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://web-gate.org/$1 [R=301,L]
	

To merge /index.html with / we add one line to.htaccess:

	RewriteRule ^index.html$ / [R=301,L] #duplicate from index.html to /

In general, this is one of those things that must be done on any site. It is easy to check whether the gluing has taken place - you enter the address that should redirect you to the main page of the site.

Do not forget that the gluing will not work if you do not write before it

RewriteEngine On

And for the RewriteEngine directive to work, you must enable the FollowSymlinks function on the PHP server

You might also like