Перейти к содержимому


SHOPCMS .htaccess переделать в WEB.CONFIG

SHOPCMS htaccess WEB.CONFIG

  • Вы не можете ответить в тему
Сообщений в теме: 2

#1 sanchios

    Пользователь

  • Download User
  • PipPip
  • 12 сообщений
Репутация: 0
Начинающий

Отправлено 17 October 2013 - 07:32 PM

Из за большой базы данных.... 50000 > товаров. Пришлось переехать на локальный хостинг... но там к сожалению уже висели другие сайты... и вы не поверите ХОСТИН на IIS... и впринципе все норм встало делегировались домена ны сервер свой, но тут трабла не работает ЧПУ. Перерыл весь инет и итог только курительные мануалы на английском и невнятные ответы типа "меняйте хостинг!". Я думаю тема акутальная и кто IIS работал может моможет... поидее там только rewriterule переписать, если кто с ходу въезжает... молю о помощи!

пример в принципе стандартного htaccess


Options +FollowSymlinks -Indexes

DirectoryIndex index.php

ErrorDocument 404 /index.php

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /(\.+) [OR]
RewriteCond %{THE_REQUEST} /(\?+) [OR]
RewriteCond %{THE_REQUEST} /(/+)
RewriteRule ^(.*)$ 404.html [L]


# BEGIN XML Sitemap
RewriteRule ^sitemap\.xml$ /xml_sitemap.php [L]
# END XML Sitemap
RewriteRule ^core/(install|temp|smarty|modules|languages|includes|functions|fonts|files|config|classes|cache|backup)/(.*) - [F]
RewriteRule ^data/(.+)\.(tpl\.html|php|php3|php4|php5|phtml|pl|cgi) - [F]
RewriteRule ^install_check\.html$ install.php?check=yes [L]
RewriteRule ^index\.html$ index.php [L]
RewriteRule ^news\.html$ index.php?news=yes [L]
RewriteRule ^price\.html$ index.php?show_price=yes [L]
RewriteRule ^cart\.html$ index.php?shopping_cart=yes [L]
RewriteRule ^wide_search\.html$ index.php?search_with_change_category_ability=yes [L]
#RewriteRule ^feedback\.html$ index.php?feedback=yes [L]
RewriteRule ^compare\.html$ index.php?comparison_products=yes [L]
RewriteRule ^page_([0-9]+)\.html$ index.php?show_aux_page=$1 [L]
RewriteRule ^product_([0-9]+)\.html$ index.php?productID=$1 [L]
RewriteRule ^category_([0-9]+)\.html$ index.php?categoryID=$1 [L]
RewriteRule ^category_([0-9]+)_offset_([0-9]+)\.html$ index.php?categoryID=$1&offset=$2 [L]
RewriteRule ^category_([0-9]+)_show_all\.html$ index.php?categoryID=$1&show_all=yes [L]
RewriteRule ^show_news_([0-9]+)\.html$ index.php?fullnews=$1 [L]
RewriteRule ^login\.html$ index.php?login_page=yes [L]

  • 0

#2 badisoft

    Продвинутый пользователь

  • Assistent vsupport.club
  • PipPipPip
  • 5075 сообщений
Репутация: 786
Мастер

Отправлено 17 October 2013 - 07:51 PM

Мне каждый раз интересно, ну вот что заставляет людей писать относительно длинное сообщение в форум вместо того, чтобы набрать в Яндексе "RewriteRule в IIS" и получить огромное количество ссылок с решением? У меня полностью удовлетворяющая сслылка в выдаче на этот запрос была вообще первой - http://olann.org.ru/...v-mirosoft-iis.
  • 0
http://cpu.badisoft.ru (тестовый сайт), http://badisoft.ru (модули)

#3 sanchios

    Пользователь

  • Download User
  • PipPip
  • 12 сообщений
Репутация: 0
Начинающий

Отправлено 18 October 2013 - 02:37 PM

Если кому интересно или покажется полезным то ниже представлено что получилось... а вообще все конвертируется замечательно стандартными модулями IIS.


<!--?xml version="1.0" encoding="UTF-8"?-->
<configuration>
    <system.webserver>
	    <rewrite>
		    <rules>
			    <rule name="Импортированное правило 1" stopprocessing="true">
				    <match url="^(.*)$" ignorecase="false">
				    <conditions logicalgrouping="MatchAny">
					    <add input="{THE_REQUEST}" pattern="/(\.+)" ignorecase="false">
					    <add input="{THE_REQUEST}" pattern="/(\?+)" ignorecase="false">
					    <add input="{THE_REQUEST}" pattern="/(/+)" ignorecase="false">
				    </add></add></add></conditions>
				    <action type="Rewrite" url="404.html">
			    </action></match></rule>
			    <rule name="Импортированное правило 2" stopprocessing="true">
				    <match url="^sitemap\.xml$" ignorecase="false">
				    <action type="Rewrite" url="/xml_sitemap.php">
			    </action></match></rule>
			    <rule name="Импортированное правило 3">
				    <match url="^core/(install|temp|smarty|modules|languages|includes|functions|fonts|files|config|classes|cache|backup)/(.*)" ignorecase="false">
				    <action type="CustomResponse" statuscode="403" statusreason="Forbidden" statusdescription="Forbidden">
			    </action></match></rule>
			    <rule name="Импортированное правило 4" enabled="true">
				    <match url="^data/(.+)\.(tpl\.html|php|php3|php4|php5|phtml|pl|cgi)" ignorecase="false">
				    <action type="CustomResponse" statuscode="403" statusreason="Forbidden" statusdescription="Forbidden">
			    </action></match></rule>
			    <rule name="Импортированное правило 5" stopprocessing="true">
				    <match url="^install_check\.html$" ignorecase="false">
				    <action type="Rewrite" url="install.php?check=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 6" stopprocessing="true">
				    <match url="^index\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php">
			    </action></match></rule>
			    <rule name="Импортированное правило 7" stopprocessing="true">
				    <match url="^news\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?news=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 8" stopprocessing="true">
				    <match url="^price\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?show_price=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 9" stopprocessing="true">
				    <match url="^cart\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?shopping_cart=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 10" stopprocessing="true">
				    <match url="^wide_search\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?search_with_change_category_ability=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 11" stopprocessing="true">
				    <match url="^compare\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?comparison_products=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 12" stopprocessing="true">
				    <match url="^page_([0-9]+)\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?show_aux_page={R:1}" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 13" stopprocessing="true">
				    <match url="^product_([0-9]+)\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?productID={R:1}" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 14" stopprocessing="true">
				    <match url="^category_([0-9]+)\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?categoryID={R:1}" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 15" stopprocessing="true">
				    <match url="^category_([0-9]+)_offset_([0-9]+)\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?categoryID={R:1}&amp;amp;offset={R:2}" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 16" stopprocessing="true">
				    <match url="^category_([0-9]+)_show_all\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?categoryID={R:1}&amp;amp;show_all=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 17" stopprocessing="true">
				    <match url="^show_news_([0-9]+)\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?fullnews={R:1}" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 18" stopprocessing="true">
				    <match url="^login\.html$" ignorecase="false">
				    <action type="Rewrite" url="index.php?login_page=yes" appendquerystring="false">
			    </action></match></rule>
			    <rule name="Импортированное правило 19">
				    <match url=".*\.(jpg|jpeg|gif|png|bmp)$">
				    <conditions logicalgrouping="MatchAll">
					    <add input="{HTTP_REFERER}" pattern="^http://ВАШСАЙТ/.*$" negate="true">
					    <add input="{HTTP_REFERER}" pattern="^http://ВАШСАЙТ$" negate="true">
					    <add input="{HTTP_REFERER}" pattern="^http://www.ВАШСАЙТ/.*$" negate="true">
					    <add input="{HTTP_REFERER}" pattern="^http://www.ВАШСАЙТ$" negate="true">
				    </add></add></add></add></conditions>
				    <action type="CustomResponse" statuscode="403" statusreason="Forbidden" statusdescription="Forbidden">
			    </action></match></rule>
		    </rules>
	    </rewrite>
    </system.webserver>
</configuration>

Сообщение отредактировал sanchios: 18 October 2013 - 02:39 PM

  • 0