Post by STG.SAC » Sat Jun 10, 2023 8:15 am

Hello good afternoon, I want to place the shortest URL of my site.
I have a site for the sale of spare parts for gastronomy.
For example, this link is for a spare part from a rational manufacturer and model 40.03.528P, and it appears as follows:
https://gastroparts.pe/index.php?route= ... duct_id=76
And I want it to look like this my_site/manufacturer/model:
https://gastroparts.pe/rational/40.03.528P
Both data are on the tab of each product.
I have been reading that you have to modify the htacces, the detail is that I have two files, one has the name that I must modify, obviously I cannot rename it because another file already exists.
One file is the following, .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
And the other file that is the one to remove the point is, .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
So the issue is what do I do with the first one because it has the name I need for the second file, do I delete it? I rename it?

Thank you.

PS, I already tried renaming the first file and it gives me the following error when I try to log in as admin: PHP7.3+ Required

Newbie

Posts

Joined
Fri Jun 18, 2021 8:41 am

Post by ADD Creative » Sat Jun 10, 2023 4:02 pm

Copy the contents of your second file into the first file, keeping the contents of the first file. So you should have one .htaccess with both contents.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

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

ok thanks, It worked perfectly, now a query, I use two languages, it won't let me use the same url for both languages, the language is not selected from OC? because the same home page is the same for both languages.

Now I also realize that the seo_url applied to the English language is indexed to the Spanish language, why?

Newbie

Posts

Joined
Fri Jun 18, 2021 8:41 am

Post by ADD Creative » Mon Jun 12, 2023 3:32 am

What version of OpenCart are you using?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by STG.SAC » Mon Jun 12, 2023 8:40 am

ADD Creative wrote:
Mon Jun 12, 2023 3:32 am
What version of OpenCart are you using?
Versión 3.0.3.8

Newbie

Posts

Joined
Fri Jun 18, 2021 8:41 am

Post by ADD Creative » Mon Jun 12, 2023 5:17 pm

OpenCart 3.x does not select the language using the URL. The language is only changed via auto detection or manually.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: mattltm and 326 guests