hehe222 Posted January 13, 2016 Share Posted January 13, 2016 Potrzebuje przekierować stronę główną tak aby po wpisaniu domena.pl przekierowywało na domena.pl/glowna/1-a.html Próbowałem coś tam w .htaccess ale jakoś mi się nie udało :/ Proszę o pomoc Link to comment Share on other sites More sharing options...
krzysiek_web Posted January 13, 2016 Share Posted January 13, 2016 RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domena.pl RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://domena.pl/glowna/1-a.html [R=301] RewriteCond %{HTTP_HOST} ^domena.pl RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://domena.pl/glowna/1-a.html [R=301,L] Link to comment Share on other sites More sharing options...
hehe222 Posted January 13, 2016 Author Share Posted January 13, 2016 (edited) # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on #Domain: www.herba-play.com RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api$ api/ [L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/x-font-woff .woff <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"> Header add Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?**********\.com$ [NC] RewriteRule ^adres1(\/.*)?$ http://www.**********.com/adres2 [R=301,L] #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again RewriteEngine On RewriteCond %{HTTP_HOST} ^www.**********.com RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://**********.com/glowna/1-a.html [R=301] RewriteCond %{HTTP_HOST} ^**********.com RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://**********.com/glowna/1-a.html [R=301,L] Tak wygląda .htaccess i coś to przekierowanie nie działa :/ Edited January 15, 2016 by hehe222 (see edit history) Link to comment Share on other sites More sharing options...
hehe222 Posted January 13, 2016 Author Share Posted January 13, 2016 RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domena.pl RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://domena.pl/glowna/1-a.html [R=301] RewriteCond %{HTTP_HOST} ^domena.pl RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://domena.pl/glowna/1-a.html [R=301,L] Jak ustawiłem to na samej górze to działało, jednak zepsuło się dodawanie do koszyka... Link to comment Share on other sites More sharing options...
hehe222 Posted January 13, 2016 Author Share Posted January 13, 2016 Dałem tu u samej góry w .htaccess i jeśli chcę dodać produkt do koszyka to pojawią się taki komunikat: Impossible to add the product to the cart.textStatus: 'error'errorThrown: ''responseText: Link to comment Share on other sites More sharing options...
pzworks Posted January 14, 2016 Share Posted January 14, 2016 Wklej RewriteCond %{HTTP_HOST} ^www.herba-play.com RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://herba-play.com/glowna/1-a.html [R=301] RewriteCond %{HTTP_HOST} ^herba-play.com RewriteCond %{REQUEST_URI} !/(.+) [NC] RewriteRule (.*) http://herba-play.com/glowna/1-a.html [R=301,L] Pod tą linią: RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] I sprawdź. Link to comment Share on other sites More sharing options...
krzysiek_web Posted January 14, 2016 Share Posted January 14, 2016 RewriteEngine On powinno być na samej górze i wklejone tylko 1 raz. Link to comment Share on other sites More sharing options...
hatak Posted January 14, 2016 Share Posted January 14, 2016 w htaccess kolejnosc jest istotna Link to comment Share on other sites More sharing options...
hehe222 Posted January 14, 2016 Author Share Posted January 14, 2016 Kurde, lipa. Próbowałem różnych rozwiązań i za każdym razem jest jakiś problem. Tak czy tak, wielkie dzięki za pomoc. Jednak znalazłem inne rozwiązanie. Napiszę je bo może ktoś będzie kiedyś potrzebował coś podobnego. W pliku /controllers/front/IndexController.php w metodzie initContent() po kodzie parent::initContent(); dodajemy to: $url = 'http://www.jakislink.pl'; header("HTTP/1.1 301 Moved Permanently");header('Location: '.$url);exit; Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now