• Как убрать # в url фильтра (PrestaShop модуль blocklayered)?

    @AgeWalker Автор вопроса
    Вот в этом тоже и проблема идет.

    Вот файл .htaccess

    <IfModule mod_rewrite.c>
    <IfModule mod_env.c>
    SetEnv HTTP_MOD_REWRITE On
    </IfModule>
    
    RewriteEngine on
    Options +FollowSymlinks
    
    # Set REQUEST_SCHEME (standard environment variable in Apache 2.4)
    RewriteCond %{HTTPS} off
    RewriteRule .* - [E=REQUEST_SCHEME:http]
    
    RewriteCond %{HTTPS} on
    RewriteRule .* - [E=REQUEST_SCHEME:https]
    
    
    
    	<IfModule mod_headers.c>
    		Header unset ETag
    	
    	  <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
    	  Header set Cache-Control "max-age=2678400, public"
    	  </filesmatch>
    	  <filesmatch "\.(html|htm)$">
    	  Header set Cache-Control "max-age=7200, private, must-revalidate"
    	  </filesmatch>
    	  <filesmatch "\.(js)$">
    	  Header set Cache-Control "max-age=2678400, private"
    	  </filesmatch>
    	</IfModule>	
    	
    	FileETag None
    
    
    
    <ifModule mod_headers.c>
    <FilesMatch "\.(jpg|jpeg|png|gif|js|css|svg|ttf|eot|otf|woff|woff2)$">
    Header set Cache-Control "max-age=3153600, public"
    </FilesMatch>
    </ifModule>
    
    # ~~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: website.tmweb.ru
    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>
    
    <IfModule mod_expires.c>
    	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"
    	ExpiresByType image/svg+xml "access plus 1 year"
    	ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
    	ExpiresByType application/font-woff "access plus 1 year"
    	ExpiresByType application/x-font-woff "access plus 1 year"
    	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    	ExpiresByType font/opentype "access plus 1 year"
    	ExpiresByType font/ttf "access plus 1 year"
    	ExpiresByType font/otf "access plus 1 year"
    	ExpiresByType application/x-font-ttf "access plus 1 year"
    	ExpiresByType application/x-font-otf "access plus 1 year"
    </IfModule>
    
    <IfModule mod_headers.c>
    	Header unset Etag
    </IfModule>
    FileETag none
    <IfModule mod_deflate.c>
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype
    	</IfModule>
    </IfModule>
    
    #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
    
    # start ~ module watermark section
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}*/admwebsite/*'"
    RewriteRule [0-9/]+/[0-9]+\.jpg$ - [F]
    </IfModule>
    # end ~ module watermark section


    Тут нет вообще ничего по catalog.

    При чем, я бы еще понял, если бы у меня после изменения в файлах модуля новый, нужный мне url заработал...
    /catalog/filter/type-kyrtka
    Но он 404 ошибку отдает.

    Куда дальше копать пока еще и не представляю даже.
    По идее в сторону изменений формул url (это я логически беру как бы в WordPress мог бы сделать, но тут PrestaShop и я без понятия как тут устроено).
  • Как в файле htacces в RewriteCond прописать условие выбора лишь подстраниц?

    @AgeWalker Автор вопроса
    Оба варианта работают!
    Спасибо за помощь!
  • Как в файле htacces в RewriteCond прописать условие выбора лишь подстраниц?

    @AgeWalker Автор вопроса
    Код:
    # WebAsyst .htaccess config
    RewriteEngine on
    
    
    AddDefaultCharset UTF-8
    RewriteEngine On
    
    RewriteCond %{HTTP:X-SSL} !^yes$
    RewriteRule (.*) https://domen.ru/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^www\.(.*)$
    RewriteRule ^(.*)$ https://%1/$1 [L,R=301]	  
    
    ##
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]
    
    RewriteCond %{THE_REQUEST} //
    RewriteRule .* /$0 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !\..{1,10}$
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ https://domen.ru/$1/ [L,R=301]
    
    RewriteCond %{REQUEST_URI} ^(.*)/index.html$
    RewriteRule ^(.*)$ https://domen.ru [R=301,L]
    
    
    # NOT WORK
    # Подстраницы на ошибку 404
    #RewriteCond %{REQUEST_URI} ^/auxpage_.*/(.*)
    #RewriteCond %{REQUEST_URI} !^/auxpage_.*/$
    #-- RewriteCond %{REQUEST_URI} ^/[auxpage]*/(.*)
    #-- RewriteCond^([^/]*)/$
    #-- RewriteCond %{REQUEST_URI} ^/auxpage_[a-Z0-9]/(.*)
    #-- RewriteCond %{REQUEST_URI} !^/auxpage_(.*)/$
    
    #--- RewriteCond %{REQUEST_URI}  ^auxpage_.+/.+$
    #--- RewriteCond %{REQUEST_URI}  !^^auxpage_.+\/$
    #RewriteRule ^(.*)$ [R=404]
    
    
    ## OLD ##
    #RewriteCond %{REQUEST_URI} !\?
    #RewriteCond %{REQUEST_URI} !\&
    #RewriteCond %{REQUEST_URI} !\=
    #RewriteCond %{REQUEST_URI} !\.
    #RewriteCond %{REQUEST_URI} !\/$
    #RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]
    
    
    RewriteCond %{REQUEST_URI} ^/category/stellazhi/$
    RewriteRule ^.*$ https://domen.ru/category/stellazhi_t0/? [R=301,L]
    
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_1 [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_o-nas/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^/published/SC/html/scripts/index.php?__furl_path=&frontend=1 [NC]
    RewriteRule ^(.*)$ http://domen.ru/ [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_nasha-nagrady [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_nashy-nagrady/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_2 [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_kak-zakazat/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_delivery [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_dostavka-i-oplata/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_350 [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_akcii/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_kontakty [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_kontakty/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_publikacii_ [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_stati/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_sitemap [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_karta-sajta/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_obrazcy-laminata_kc9 [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_obrazcy-laminata/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=pricelist [NC]
    RewriteRule ^(.*)$ http://domen.ru/pricelist/? [R=301,L]
    
    RewriteCond %{QUERY_STRING} ^ukey=auxpage_mehanizmy-transformacii [NC]
    RewriteRule ^(.*)$ http://domen.ru/auxpage_mehanizmy-transformacii/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/akcii_i_rasprodazha/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/rasprodazha/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/stulja-i-taburetki/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/stulya-dlya-kuhni/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/shkafy/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/shkafy-kupe/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/ugolki/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/kuhonnye-ugolki/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/prihozhiekomodytv-tumby/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/modulnye-prihozhie/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/detskie-stenki/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/mebel-dlya-detskoy-komnaty/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/category/stoly/$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/category/zhurnalnye-stoly/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} ^/index.php$
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/? [R=301,L]
    
    RewriteCond %{REQUEST_URI} /home
    RewriteCond %{QUERY_STRING} ^\z
    RewriteRule ^(.*)$ http://domen.ru/? [R=301,L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^shop/(repo_themes|js|3rdparty|images_common|products_pictures|images|themes|css)/(.*)$ published/SC/html/scripts/$1/$2?frontend=1 [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^shop/(imgval.php|wbs_messageserserver.php) published/SC/html/scripts/$1 [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^(repo_themes|js|3rdparty|images_common|products_pictures|images|themes|css)/(.*)$ published/SC/html/scripts/$1/$2?frontend=1 [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^(imgval.php|wbs_messageserserver.php|get_file.php) published/SC/html/scripts/$1 [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^shop(.*) published/SC/html/scripts/$1&frontend=1 [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^login/(.*) login/index.php [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^installer/(.*) installer/index.php [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteRule ^published/$ published/index.php [L]
    
    RewriteCond  %{REQUEST_FILENAME} !-f
    RewriteCond  %{REQUEST_URI} !^published
    RewriteRule (.*) published/SC/html/scripts/index.php?__furl_path=$1&frontend=1 [QSA]
    
    RewriteCond %{HTTP_HOST} ^www\.(.*)$
    RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
    
    
    # сжатие text, html, javascript, css, xml:
    <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_expires.c>
     ExpiresActive On
     #кэшировать флэш и изображения на месяц
     ExpiresByType image/x-icon "access plus 7 days"
     ExpiresByType image/jpeg "access plus 7 days"
     ExpiresByType image/png "access plus 7 days"
     ExpiresByType image/gif "access plus 7 days"
     ExpiresByType application/x-shockwave-flash "access plus 7 days"
     #кэшировать css, javascript и текстовые файлы на одну неделю
     ExpiresByType text/css "access plus 7 days"
     ExpiresByType text/javascript "access plus 7 days"
     ExpiresByType application/javascript "access plus 7 days"
     ExpiresByType application/x-javascript "access plus 7 days"
     #кэшировать html и htm файлы на один день
     ExpiresByType text/html "access plus 1 day"
     #кэшировать xml файлы на десять минут
     ExpiresByType application/xhtml+xml "access plus 10 minutes"
    </ifModule>
  • Как в файле htacces в RewriteCond прописать условие выбора лишь подстраниц?

    @AgeWalker Автор вопроса
    Попробовал прописать как вы и сказали:

    RewriteCond %{REQUEST_URI}  ^auxpage_.+/.+$
    RewriteCond %{REQUEST_URI}  !^^auxpage_.+\/$
    RewriteRule ^(.*)$ [R=404]


    К сожалению не помогло.
    Даже так:
    RewriteCond %{REQUEST_URI}  ^auxpage_.+/.+$
    RewriteRule ^(.*)$ [R=404]

    ничего не выдавало 404.
    То есть страница /auxpage_kak-zakazat/123/ и /auxpage_kak-zakazat/ выдавали одно и тоже. Ошибки 404 подстраница не выдала

    PS. RewriteEngine On, если кто спросит, заранее прописан. Дело не в нем.