Redirect with htaccess

1

I need to make a target, when the user accesses, link is directed to link

Is it possible to do this with .htaccess?

Here is the code I have:

<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} OPTIONS
    RewriteRule .* / [R=200,L]
    RewriteRule ^portal/([a-z0-9\-]+)/$ ^blog/ [QSA]
</ifModule>

Note: Inside the portal folder, I already have an index.php pointing to blog. This .htaccess would go inside this folder.

    
asked by anonymous 18.05.2017 / 13:20

1 answer

1

Within the .htaccess file that is inside the public_html / folder of your account, simply add the line below:

RewriteCond %{HTTP_HOST} ^domínio\.com\.br$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domínio\.com\.br$
RewriteRule ^/?$ "http\:\/\/domínio\.com\/pastaredirecionada\/" [R=301,L]

This redirect is more complex and indicates (in the example above) that the domain "domain.com" (without quotation marks) will redirect to "domain.com / pastaredirect /" (without quotes). It may be without the folder as well.

    
18.05.2017 / 13:33