1

Usually we will have opencart urls something like this

http://localhost/sample/

I am trying to add location to this urls something like this

http://localhost/sample/geolocation

So I have modified my htaccess to work accordingly and it works but it does breaks my JS, CSS and Images.

Options +FollowSymlinks
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
</FilesMatch>

RewriteEngine On

RewriteBase /sample/

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?city=$1&_route_=$2 [L,QSA]  # This is my modification
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

This is one of my js urls look like http://localhost/sample/catalog/view/javascript/jquery/jquery-2.1.1.min.js

Prabhakaran
  • 3,900
  • 15
  • 46
  • 113

1 Answers1

0

I have created a .htaccess file in each directory I want to skip the rewrite and put this in the file

RewriteEngine Off
Prabhakaran
  • 3,900
  • 15
  • 46
  • 113