Jump to content

[Solved] www redirect .htaccess


kubaf

Recommended Posts

Ahoj,

nainstaloval jsem na domenu prestashop a nyni se potykam s problemem redirectu domeny z http://neco.cz na http://www.neco.cz . Kdyz zadam http://www.neco.cz/info.php nebo uz nejakou konkretni adresu souboru pres www, tak to funguje. Nicmene samotny redirect nikoli. Nevite, kde by mohla byt chyba? Zde vypisiuji muj .htaccess soubor. Diky za jakykoli tip!



# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums
RewriteEngine on

# URL rewriting module activation

RewriteCond %{HTTP_HOST} ^neco.cz$ [nc] 
RewriteRule ^(.*)$ http://www.neco.cz/$1 [R=301,L] 

# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg [L]
RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg [L]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg [L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$1 [QSA,L]
RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*) /supplier.php?id_supplier=$1 [QSA,L]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*) /manufacturer.php?id_manufacturer=$1 [QSA,L]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms=$1 [QSA,L]
RewriteRule ^content/category/([0-9]+)\-([a-zA-Z0-9-]*) /cms.php?id_cms_category=$1 [QSA,L]
RewriteRule ^([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]* /category.php?id_category=$2&isolang;=$1 [QSA,L]
RewriteRule ^([a-z]{2})/content/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id;_cms=$2 [QSA,L]
RewriteRule ^([a-z]{2})/content/category/([0-9]+)\-[a-zA-Z0-9-]* /cms.php?isolang=$1&id;_cms_category=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)__[a-zA-Z0-9-]* /supplier.php?isolang=$1&id;_supplier=$2 [QSA,L]
RewriteRule ^([a-z]{2})/([0-9]+)_[a-zA-Z0-9-]* /manufacturer.php?isolang=$1&id;_manufacturer=$2 [QSA,L]
RewriteRule ^en/page-not-found$ /404.php?isolang=en [QSA,L]
RewriteRule ^en/address$ /address.php?isolang=en [QSA,L]
RewriteRule ^en/addresses$ /addresses.php?isolang=en [QSA,L]
RewriteRule ^en/authentication$ /authentication.php?isolang=en [QSA,L]
RewriteRule ^en/best-sales$ /best-sales.php?isolang=en [QSA,L]
RewriteRule ^en/cart$ /cart.php?isolang=en [QSA,L]
RewriteRule ^en/contact-us$ /contact-form.php?isolang=en [QSA,L]
RewriteRule ^en/discount$ /discount.php?isolang=en [QSA,L]
RewriteRule ^en/guest-tracking$ /guest-tracking.php?isolang=en [QSA,L]
RewriteRule ^en/order-history$ /history.php?isolang=en [QSA,L]
RewriteRule ^en/identity$ /identity.php?isolang=en [QSA,L]
RewriteRule ^en/manufacturers$ /manufacturer.php?isolang=en [QSA,L]
RewriteRule ^en/my-account$ /my-account.php?isolang=en [QSA,L]
RewriteRule ^en/new-products$ /new-products.php?isolang=en [QSA,L]
RewriteRule ^en/order$ /order.php?isolang=en [QSA,L]
RewriteRule ^en/order-follow$ /order-follow.php?isolang=en [QSA,L]
RewriteRule ^en/quick-order$ /order-opc.php?isolang=en [QSA,L]
RewriteRule ^en/order-slip$ /order-slip.php?isolang=en [QSA,L]
RewriteRule ^en/password-recovery$ /password.php?isolang=en [QSA,L]
RewriteRule ^en/prices-drop$ /prices-drop.php?isolang=en [QSA,L]
RewriteRule ^en/search$ /search.php?isolang=en [QSA,L]
RewriteRule ^en/sitemap$ /sitemap.php?isolang=en [QSA,L]
RewriteRule ^en/stores$ /stores.php?isolang=en [QSA,L]
RewriteRule ^en/supplier$ /supplier.php?isolang=en [QSA,L]
RewriteRule ^en/([^?&]*) /$1?isolang=en [QSA,L]
RewriteRule ^cs/page-not-found$ /404.php?isolang=cs [QSA,L]
RewriteRule ^cs/address$ /address.php?isolang=cs [QSA,L]
RewriteRule ^cs/addresses$ /addresses.php?isolang=cs [QSA,L]
RewriteRule ^cs/authentication$ /authentication.php?isolang=cs [QSA,L]
RewriteRule ^cs/best-sales$ /best-sales.php?isolang=cs [QSA,L]
RewriteRule ^cs/cart$ /cart.php?isolang=cs [QSA,L]
RewriteRule ^cs/contact-us$ /contact-form.php?isolang=cs [QSA,L]
RewriteRule ^cs/discount$ /discount.php?isolang=cs [QSA,L]
RewriteRule ^cs/guest-tracking$ /guest-tracking.php?isolang=cs [QSA,L]
RewriteRule ^cs/order-history$ /history.php?isolang=cs [QSA,L]
RewriteRule ^cs/identity$ /identity.php?isolang=cs [QSA,L]
RewriteRule ^cs/manufacturers$ /manufacturer.php?isolang=cs [QSA,L]
RewriteRule ^cs/my-account$ /my-account.php?isolang=cs [QSA,L]
RewriteRule ^cs/new-products$ /new-products.php?isolang=cs [QSA,L]
RewriteRule ^cs/order$ /order.php?isolang=cs [QSA,L]
RewriteRule ^cs/order-follow$ /order-follow.php?isolang=cs [QSA,L]
RewriteRule ^cs/quick-order$ /order-opc.php?isolang=cs [QSA,L]
RewriteRule ^cs/order-slip$ /order-slip.php?isolang=cs [QSA,L]
RewriteRule ^cs/password-recovery$ /password.php?isolang=cs [QSA,L]
RewriteRule ^cs/prices-drop$ /prices-drop.php?isolang=cs [QSA,L]
RewriteRule ^cs/search$ /search.php?isolang=cs [QSA,L]
RewriteRule ^cs/sitemap$ /sitemap.php?isolang=cs [QSA,L]
RewriteRule ^cs/stores$ /stores.php?isolang=cs [QSA,L]
RewriteRule ^cs/supplier$ /supplier.php?isolang=cs [QSA,L]
RewriteRule ^cs/([^?&]*) /$1?isolang=cs [QSA,L]


Link to comment
Share on other sites

pokracovani souboru


# Catch 404 errors
ErrorDocument 404 /404.php


   ExpiresActive On
   ExpiresByType image/gif "access plus 1 month"
   ExpiresByType image/jpeg "access plus 1 month"
   ExpiresByType image/png "access plus 1 month"
   ExpiresByType text/css "access plus 1 week"
   ExpiresByType text/javascript "access plus 1 week"
   ExpiresByType application/javascript "access plus 1 week"
   ExpiresByType application/x-javascript "access plus 1 week"
   ExpiresByType image/x-icon "access plus 1 year"


FileETag INode MTime Size

   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/javascript
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/x-javascript


Link to comment
Share on other sites

no je to proste, prikaz na presmerovani se totiz nezapisuje do slozky s prestou:-) takze ho dejte pryc a vytvorte soubor htaccess ve slozce ze ktere se ma smerovat a tam ho teprve dejte. Jinak hledejte navody na netu je jich dostatek...

Link to comment
Share on other sites

Dobry den, dekuji za odpoved. Presto si myslim, ze muj problem to neresi. Jde mi ted o presmerovani z adresy formatu http://mojeadresa.cz na http://www.mojeadresa.cz . To se bude tusim nastavovat v hlavnim souboru .htaccess, ktery se nachazi v rootovskem adresari hostingu. Svuj .htaccess soubor jsem upravil podle nastaveni, ktere pisou zde: http://www.presto-changeo.com/en/content/6-prestashopseotips . Mozna jsem vas jen spravne nepochopil. Tak se prosim kdyztak rozepiste. Diky.

Link to comment
Share on other sites

Tak problem byl klasicky mezi zidli a klavesnici. Neprekontoloval jsem si, ze v nastaveni obchodu ve volbe "Preferences -> SEO & URLS" nemam v domene obchodu nastaveny format adresy www.mujobchod.cz ale pouze mujobchod.cz . Coz zpusobovalo zacykleni redirectu z www.mujobchod.cz na mujobchod.cz a nasledne zpet na www.mujobchod.cz.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...