Página 1 de 2
URL Amigavel na barra de endereços
Enviado: 06 Dez 2012, 19:46
por Felipe Calife
Sei que existem outros tópicos sobre o assunto mas nenhum (inefelizmente) sobre a minha questão.
Segui o procedimento daqui da comunidade para habilitar as URL amigáveis e está tudo funcionando perfeito.
O único "problema" é que quando clico no link, na
barra de endereços não aparece como URL amigável, apesar dela aparecer correta na
barra inferior do browser qdo coloco o cursor sobre o link.
Exemplo:
www.meusite.com.br/index.php?_route_=Vestidos quando a url deveria ser
www.meusite.com.br/Vestidos.
Se eu digitar a 2a opcao eu "caio" no departamento correto. Só queria que o cliente visse na sua barra de endereços (aquele em que escrevemos a URL) a URL amigável.
Alguma idéia?
Obg
Re: URL Amigavel na barra de endereços
Enviado: 07 Dez 2012, 15:59
por anderson85
Estou com um problema parecido, porém tudo aconteceu depois que eu habilitei o ssl do site.
Está tudo funcionando bem porém o site estava com a seguinte url:
<<<
http://www.meusite.com.br/o-que/almofad ... onalizadas>>>
e agora esta assim
<<<
https://www.meusite.com.br/index.php?_r ... onalizadas.>>>
Alguma idéia?
Re: URL Amigavel na barra de endereços
Enviado: 09 Dez 2012, 10:32
por periscuelo
Para mim isso parece um .htaccess habilitado com opção de url amigável desabilitada no opencart. Mas posso estar errado. Tente utilizar o .htaccess original do opencart pois pode ser que devido a alguma alteração ele esteja funcionando erroneamente.
Re: URL Amigavel na barra de endereços
Enviado: 09 Dez 2012, 11:11
por Felipe Calife
Periscuelo, obrigado por responder minha dúvida.
Meu opencart está com a URL amigável ativada no Dashboard.
Tenho certificado SSL instalado no site e segue meu .htaccess para você dar uma olhada:
# 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 Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
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=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://www.yourwebsite.co.uk? [R=301,L]
### 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
<FilesMatch ^config.php$>
Deny from all
</FilesMatch>
# Acesso http redirecionado para https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
# Turn off ETags
FileETag None
# Turn off ETags
FileETag None
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/javascript.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType application/javascript "access plus 2592000 seconds"
ExpiresByType application/x-javascript "access plus 2592000 seconds"
</ifModule>
<ifModule mod_headers.c>
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=2592000, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>
Alguma idéia?
Obrigado.
Re: URL Amigavel na barra de endereços
Enviado: 10 Dez 2012, 10:22
por periscuelo
Desculpe amigo Felipe mas to sem tempo para analisar seu .htaccess. Como eu disse antes, tente usar o .htaccess padrão (sem alterações) do opencart e ver se funciona. Se funcionar, vá acrescentando aos poucos as alterações e testando para ver qual delas está causando o erro. Ai fica mais fácil de saber oque você precisa fazer que não está dando certo para que o pessoal possa te ajudar. Abraços.
Re: URL Amigavel na barra de endereços
Enviado: 10 Dez 2012, 15:15
por Felipe Calife
Olá Periscuelo,
obrigado pela sugestão mas comentei cada uma das linhas da seção de SEO URL do meu .htaccess e nada mudou.
Alguém mais tem alguma sugestão?
Re: URL Amigavel na barra de endereços
Enviado: 11 Dez 2012, 10:05
por periscuelo
Na verdade @Felipe minha sugestão foi trocar o .htaccess pelo .htaccess padrão que vem com o opencart e não comentar as linhas. Mas beleza. Espero que consiga resolver seu problema

Re: URL Amigavel na barra de endereços
Enviado: 11 Dez 2012, 12:36
por marcelomaffezoli
Você usa algum módulo para isso? Eu uso uma extensão em vqmod que funciona perfeitamente.
Da uma olhada na minha loja teste:
www.mmweb.com.br/loja
Re: URL Amigavel na barra de endereços
Enviado: 11 Dez 2012, 12:49
por Felipe Calife
Oi Marcelo,
na sua loja está ok. Vc nao tem certificado SSL na loja toda, ne? Em algum lugar li que podia ter a ver com isso meu problema.
Só os produtos de sua loja não tem SEO URL mas acho que é porque você não cadastrou.
Já testei dois Vmods que não resolveram meu problema:
beop_all_clean_urls.xml e remove_common_home.xml
Qual você usa?
Abs
Re: URL Amigavel na barra de endereços
Enviado: 03 Jun 2014, 00:31
por IFW
Olá Felipe,
Sei que o tópico foi aberto há muito tempo, se ainda estiver interessado em resolver seu problema (caso não tenha resolvido), vou te dar uma sugestão.
O redirecionamento deve ficar antes das rotas, portanto, tente dessa forma:
RewriteBase /
# redirecionamentos primeiro
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://www.yourwebsite.co.uk? [R=301,L]
# rotas em seguida
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [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]
Limpe o cache, o histórico do seu navegador e veja se funcionou.
Espero ter ajudado
