Redirect 301 works locally but not on the server

0

I'm having problems with htaccess again. Working in local work for me without any problem, but in the server does not redirect me well.

For example, having this old URL:

https://www.laxtore.com/Juegos/Xbox-One/37/EA-SPORTS-FIFA-17/

I should be redirected to:

https://www.laxtore.com/es/juegos/xbox-one/37/EA-SPORTS-FIFA-17/

But it redirects me to this URL:

https://www.laxtore.com/home/admin/web/laxtore.com/public_html/es/juegos/xbox-one/37/EA-SPORTS-FIFA-17/

It happens to me with all the redirects 301 that I have applied. For the case of the URL that I have set, I redirect it in this way:

RewriteRule ^Juegos/Xbox-One/ es/juegos/xbox-one/ [R=301,L]

I do not understand where the problem is. I make it clear that all of them have worked for me, but when I upload it to the server, none of them work for me. Right before the redirects I have this:

RewriteEngine on
RewriteRule ^sitemap\.xml/?$ sitemap.php
RewriteCond %{HTTP_HOST} ^laxtore.com [NC]
RewriteRule ^(.*)$ http://www.laxtore.com [L,R=301,NC]

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
    
asked by JetLagFox 03.03.2018 в 21:29
source

1 answer

0

Make sure you have the Document Root set correctly in your httpd.conf .

DocumentRoot /home/admin/web/laxtore.com/public_html

Restarting Apache to take the configuration.


And in the .htaccess, in cases where Apache is having trouble locating which folder it is in, you have to use RewriteBase

# si estás en el document root de tu web
RewriteBase /

#   o en cualquier otra carpeta
# RewriteBase /otra/carpeta
    
answered by 12.03.2018 в 23:29