Why should you choose WebGate?

  • Expertise: Our team comprises seasoned designers with a proven track record in delivering cutting-edge designs that align with industry trends and user expectations.
  • Collaboration: We believe in the power of collaboration. Throughout the design process, we work closely with you, ensuring your vision is not only met but exceeded.
  • Innovation: Stay ahead of the curve with innovative design solutions. We don't just follow trends; we set them, providing you with a digital presence that stands out.
  • User-Centric Approach: Your users are at the core of our design philosophy. Through user research and testing, we create designs that resonate with your target audience.
sports blog 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