Post by STG.SAC » Fri Jun 09, 2023 1:07 am

Hola buenas tardes, deseo colocar las URL mas cortas de mi sitio.
Tengo un sitio de venta de repuestos para gastronomia.
Por ejemplo este enlace es de un repuesto de fabricante rational y nodelo 40.03.528P, y aparece de la siguiente manera:
https://gastroparts.pe/index.php?route= ... duct_id=76
Y deseo que se vea asi mi_stio/fabricante/modelo:
https://gastroparts.pe/rational/40.03.528P
Ambos datos están en la ficha de cada producto.
He estado leyendo que hay que modificar el htacces, el detalle es que yo tengo dos archivos, uno tiene el nombre como el que debo modificar, obviamente no puedo renombrarlo porque ya existe otro archivo.
Un archivo es el siguiente, .htaccess

Code: Select all

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Y el otro archivo que es el que hay que quitarle el punto es, .htaccess.

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directory listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
#RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none
Entonces el asunto es que hago con el primero porque tiene el nombre que necesito para el segundo archivo, lo borro? lo renombro?

Gracias.

PD, ya probé renombrando el primer archivo y me da el siguiente error cuando intento entrar como admin: PHP7.3+ Required

Newbie

Posts

Joined
Fri Jun 18, 2021 8:41 am

Post by xxvirusxx » Sun Jun 11, 2023 1:29 am

Enable SEO url from store settings and rename .htaccess.txt to .htaccess

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by STG.SAC » Mon Jun 12, 2023 1:53 am

Respondiendome a mi mismo, por si a alguien mas le sirve, quien tenga dos archivos htaccess, copie el segundo en el primero y ya comenzó a trabajar.
Ahora tengo una duda con respecto a las url del producto, hay que generar dos diferentes (por tener dos idiomas), pensé que la selecion de idiomas era por la misma pagina, que alternaba la traduccion, por ejemplo el inicio es la misma direccion para ambos idiomas, mas no para un producto, me tiene algo confundido.

Newbie

Posts

Joined
Fri Jun 18, 2021 8:41 am

Post by supersonic34 » Fri Jul 07, 2023 11:25 pm

El problema lo tienes en el archivos htaccess puedes modificarlo, pero si no lo haces bien, puedes romper la pagina web. Te recomiendo hacer copia de seguridad antes de tocar cualquier cosa de la web.

User avatar
Newbie

Posts

Joined
Thu Jul 06, 2023 9:21 pm
Location - Barcelona
Who is online

Users browsing this forum: No registered users and 2 guests