I
I
Ilya Pankov2015-12-04 00:15:28
PHP
Ilya Pankov, 2015-12-04 00:15:28

Is it possible to write the perfect .htaccess?

Hello
There is a site without CMS. The SEO specialist wants to bring it to the top
. To do this, he asks to convert pages like mysite.ru/set.html into mysite.ru/set.
The fact is that my site is without a CMS and you need to write the code manually, no problem.
index.html and set.html are in the same folder.
When trying to write a standard .htaccess error 403 occurs.
Dear experts, is it possible to write a perfect .htaccess for SEO?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Robot, 2015-12-04
@iam_not_a_robot

Firstly, he says nonsense, if you had:
mysite.ru/446782.php?id=6&name=8&date=9
then yes, but with and without html - this is the same from the point of view of SEO
In general, even on the site without CMS it is possible to do routing, do you have traffic now? Because it will be necessary to set redirects and in short you will lose it most likely for a while if you change the addresses.

S
Sergey Goryachev, 2015-12-04
@webirus

In principle, you were rightly told about the nonsense about search engine optimization and file permission, but if you want to have it purely aesthetically without .php and .html, then here's a simple syntax.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

.html is removed in the same way

N
Nazar Mokrinsky, 2015-12-04
@nazarpc

RTFM: habrahabr.ru/company/sprinthost/blog/129560

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question