WebSite X5Help Center

 
Marius T.
Marius T.
User

.htaccess File  en

Автор: Marius T.
Просмотрено 1546, Подписчики 1, Размещенный 0  

Hi

I have asearched for a subject about editing the .htaccess file but there is no topic.

Brief the file has this conent:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php56___lsphp .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

ANd I need to ad a line like this for redirect:

Redirect / http://www.softedu.eu/

The question is where and how to edit in order to ad this line. I have no clue about Php.

Размещено
9 Ответы - 1 Полезно - 1 Корректно
Marius T.
Marius T.
User
Автор

Thanks Andre. As I have written I have zero knowledge about Php. This is the reason I have asked because after reading your link I am not clear: the line thaT I have to add is Redirect / http://www.softedu.eu/
Also I can see that every comment inside .htaccess begin with # and every line code begin with < and it is ending also with >.

Which is the correct syntax to add my line?

Redirect / http://www.softedu.eu/

or

<Redirect / http://www.softedu.eu/>

Читать больше
Размещено От Marius T.
Claudio D.
Claudio D.
Moderator
Лучший пользователь месяца IT

Htaccess is NOT in PHP language.


What would you like to do with that redirect ?

Читать больше
Размещено От Claudio D.
Franz-Josef H.
Franz-Josef H.
Moderator

if you want to redirect all pages of the existing website to a new domain and the navigation structure should remain the same, use this code

RewriteEngine On

Redirect 301 / www.softedu.eu/

when redirecting with a changed navigation structure, you still have to specify the start page, so use this code

RewriteEngine On

Redirect 301 / www.softedu.eu/index.html 

Читать больше
Размещено От Franz-Josef H.
Marius T.
Marius T.
User
Автор

I try to redirect the entire web site to www version because now there are both www and no-www available.

Thanks Franz-Josef and Claudio.

Читать больше
Размещено От Marius T.
Franz-Josef H.
Franz-Josef H.
Moderator

Since that's a slightly different topic, you'd better use this code to forward everything that is not www to the domain with www 

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.softedu\.eu$ [NC]

RewriteRule ^(.*)$ https://www.softedu.eu/$1 [R=301,L]

Читать больше
Размещено От Franz-Josef H.
Marius T.
Marius T.
User
Автор

So I will copy the code bellow the last row exactly like this? Without last S because is not https but http.

Thank you so much, really appreciate!

Читать больше
Размещено От Marius T.
Franz-Josef H.
Franz-Josef H.
Moderator

you need all three lines from the post above. It's correct: if you don't have an SSL certificate, you only write http and not https.

Читать больше
Размещено От Franz-Josef H.
Marius T.
Marius T.
User
Автор

Many thanks once again! 

Читать больше
Размещено От Marius T.