.htaccess - Custom url rewrite in prestashop 1.6 -


i'm using prestashp , wanted add custom rewrited url in .htaccess. have page, admin.php?p=test (let's say), , want rewrite /test_shop. i've added @ absolute bottom of htaccess line:

rewriterule ^([^/]*)_shop$ /admin.php?p=$1 [l] 

it doesn't work. if access /anything_shop ... says page isn't found. why?

inside htaccess:

# ~~start~~ not remove comment, prestashop keep automatically code outside comment when .htaccess generated again # .htaccess automaticaly generated prestashop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums  rewriteengine on #rewritecond %{request_method} !^(trace|track|get|post|head)$ #rewriterule .* - [f] #rewritebase / #options +followsymlinks rewriterule ^([^/]*)_shop$ /admin.php?p=$1 [l]  <ifmodule mod_rewrite.c> <ifmodule mod_env.c> setenv http_mod_rewrite on </ifmodule>  rewriteengine on  #domain: srv.sefulgalaxiei.me rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule . - [e=rewritebase:/ps/] rewriterule ^api$ api/ [l]  rewriterule ^api/(.*)$ %{env:rewritebase}webservice/dispatcher.php?url=$1 [qsa,l]  # images rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$1$2$3.jpg [l] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^([0-9])([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$2/$1$2$3$4.jpg [l] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^c/([0-9]+)(\-[\.*_a-za-z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/c/$1$2$3.jpg [l] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^c/([a-za-z_-]+)(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/c/$1$2.jpg [l] # alphaimageloader ie , fancybox rewritecond %{http_host} ^srv.sefulgalaxiei.me$ 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 rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^.*$ - [nc,l] rewritecond %{http_host} ^srv.sefulgalaxiei.me$ rewriterule ^.*$ %{env:rewritebase}index.php [nc,l]   #domain: bos.sefulgalaxiei.me rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule . - [e=rewritebase:/ps/] rewriterule ^api$ api/ [l]  rewriterule ^api/(.*)$ %{env:rewritebase}webservice/dispatcher.php?url=$1 [qsa,l]  # images rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule ^([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$1$2$3.jpg [l] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule ^([0-9])([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$2/$1$2$3$4.jpg [l] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule ^c/([0-9]+)(\-[\.*_a-za-z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/c/$1$2$3.jpg [l] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule ^c/([a-za-z_-]+)(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/c/$1$2.jpg [l] # alphaimageloader ie , fancybox rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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 rewritecond %{http_host} ^bos.sefulgalaxiei.me$ rewriterule ^.*$ - [nc,l] rewritecond %{http_host} ^bos.sefulgalaxiei.me$ 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>  #if rewrite mod isn't enabled errordocument 404 /ps/index.php?controller=404  # ~~end~~ not remove comment, prestashop keep automatically code outside comment when .htaccess generated again 

/// problem solved need add:

rewritebase /ps/ 

before rule.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -