Redirect URL to mobile version with .htaccess

0

I'm making the mobile version of a website and I need it to redirect any page to its mobile version:

Ex: If the page accessed is link you should redirect to link

And so on to all the others.

Note:

  • I do not know much about .htaccess.
  • I did not do the site.
  • As I've noted, .htaccess is making the system "urls     friendly "to the site.
  • Current file:

    # Ativa o suporte à reescrita
    RewriteEngine On
    
    Options +FollowSymLinks
    
    #============== Para colocar o www se a url não tiver
    RewriteCond %{HTTP_HOST} !^www [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    
    #============= Para colocar barra no final da URL que não tiver
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
    
    
    # Não aplica a condição para arquivos
    RewriteCond %{SCRIPT_FILENAME} !-f
    
    # Não aplica a condição para diretórios
    RewriteCond %{SCRIPT_FILENAME} !-d
    
    # Regra de reescrita onde qualquer string (.*) após a pasta, 
    # onde estiver o .htaccess, será interpretado por index.php passado na variável cod
    RewriteRule ^(.*)$ index.php?par=$1
    
        
    asked by anonymous 09.08.2017 / 14:45

    1 answer

    0

    You can use htaccess redirect 301. It is very simple to do this, you just specify the Redirect 301 and pass two information, the first is the old url and the other is the new url to be permanent.

    Ex:

    Redirect 301 /home-antiga /m/home-nova 
    
        
    16.08.2017 / 21:49