{"id":258,"date":"2013-12-27T13:46:57","date_gmt":"2013-12-27T05:46:57","guid":{"rendered":"http:\/\/web.jofar.cn\/?p=258"},"modified":"2013-12-27T13:46:57","modified_gmt":"2013-12-27T05:46:57","slug":"%e4%bc%aa%e9%9d%99%e6%80%81%e5%8a%9f%e8%83%bd%e5%ae%9e%e4%be%8b","status":"publish","type":"post","link":"https:\/\/web.jofar.cn\/?p=258","title":{"rendered":"\u4f2a\u9759\u6001\u529f\u80fd\u5b9e\u4f8b"},"content":{"rendered":"<p>\u4f2a\u9759\u6001\u5b9e\u73b0\u7684\u539f\u7406\u5c31\u662f index.php?act=about&amp;cid=1 \u5c06\u8fd9\u79cd\u5f62\u5f0f\u7684\u52a8\u6001\u8def\u5f84\u7528 about-1.html \u8fd9\u79cd\u5f62\u5f0f\u8f93\u51fa\uff0c\u6839\u636e\u4e0d\u540c\u7684\u670d\u52a1\u5668\u73af\u5883\uff0c\u914d\u7f6e\u65b9\u6cd5\u4e5f\u4e0d\u592a\u4e00\u6837\uff0cPHP+iis6\u7684\u8bdd\u5c31\u8981\u914d\u7f6ehttpd.ini\u6587\u4ef6\uff0cphp+iis7\u5c31\u8981\u914d\u7f6eweb.config,PHP+apache\u5c31\u8981\u914d\u7f6e.htaccess\u6587\u4ef6(php+iis\u73b0\u5728\u65b0\u7248\u597d\u8c61\u5df2\u4e0eapache\u7684\u65b9\u6cd5\u5b8c\u5168\u517c\u5bb9)<br \/>\n.htaccess\u89c4\u5219\u793a\u4f8b\uff1a<br \/>\nRewriteEngine on<\/p>\n<p>RewriteRule ^\/?(index|guestbook|online)\\.html$ index\\.php [L]<\/p>\n<p>RewriteRule ^\/?(eindex)\\.html$ index\\.php?act=$1 [L]<\/p>\n<p>RewriteRule ^\/?(index|guestbook|online)-([0-9]+).html$ index\\.php\\?p=$2 [L]<\/p>\n<p>RewriteRule ^\/?([a-z0-9]+)_([0-9]+).html$ index\\.php\\?act=$1&amp;id=$2 [L]<\/p>\n<p>RewriteRule ^\/?([a-z0-9]+)-([0-9]+).html$ index\\.php\\?act=$1&amp;cid=$2 [L]<\/p>\n<p>RewriteRule ^\/?([a-z0-9]+)-([0-9]+)-([0-9]+).html$ index\\.php\\?act=$1&amp;cid=$2&amp;p=$3 [L]<\/p>\n<p>httpd.ini\u793a\u4f8b\uff1a<br \/>\n[ISAPI_Rewrite]<\/p>\n<p>RepeatLimit 32<\/p>\n<p># Block external access to the httpd.ini and httpd.parse.errors files<br \/>\nRewriteRule \/httpd(?:\\.ini|\\.parse\\.errors).* \/ [F,I,O]<\/p>\n<p># Block external access to the Helper ISAPI Extension<br \/>\nRewriteRule .*\\.isrwhlp \/ [F,I,O]<br \/>\nRewriteRule ^\/(index|guestbook|online)\\.html$ \/$1\\.php<\/p>\n<p>RewriteRule ^\/(eindex).html$ \/index\\.php\\?act=$1<\/p>\n<p>RewriteRule ^\/(index|guestbook|online)-([0-9]+).html$ \/$1\\.php\\?p=$2<\/p>\n<p>RewriteRule ^\/([a-z0-9]+)_([0-9]+).html$ \/index\\.php\\?act=$1&amp;id=$2<\/p>\n<p>RewriteRule ^\/([a-z0-9]+)-([0-9]+).html$ \/index\\.php\\?act=$1&amp;cid=$2<\/p>\n<p>RewriteRule ^\/([a-z0-9]+)-([0-9]+)-([0-9]+).html$ \/index\\.php\\?act=$1&amp;cid=$2&amp;p=$3<br \/>\nweb.config\u5b9e\u4f8b<br \/>\nHow to make SEO friendly URL\u2019s for Opencart on IIS Server<br \/>\nUncategorized by admin<br \/>\nWe all know how to rewrite urls for opencart on Linux servers. but if you are one of those who have opencart installed on windows servers then you must have faced issues with URL rewriting.<br \/>\nSo here we go, just follow this simple steps and your opencart application can have SEO friendly URLs on IIS server too.<br \/>\nLog in to the admin panel -&gt; go to System ?C Settings . Click on Edit -&gt; go to server tab and click yes for SEO friendly urls.<br \/>\nWell this is the easy step.<br \/>\nNow a bit of coding stuff.<br \/>\nCreate a web.config file, so remember that what .htaccess file is to Apache server, we.config is to IIS server.<br \/>\nweb.config code start<\/p>\n<p>&lt;?xml version=\u201d1.0\u2033 encoding=\u201dUTF-8\u2033?&gt;<br \/>\n&lt;configuration&gt;<br \/>\n&lt;system.webServer&gt;<br \/>\n&lt;rewrite&gt;<br \/>\n&lt;rules&gt;<br \/>\n&lt;rule name=\u201dImported Rule 1\u2033 stopProcessing=\u201dtrue\u201d&gt;<br \/>\n&lt;match url=\u201d^(.*)$\u201d ignoreCase=\u201dfalse\u201d \/&gt;<br \/>\n&lt;conditions&gt;<br \/>\n&lt;add input=\u201d{HTTP_HOST}\u201d pattern=\u201d^yourdomain\\.com$\u201d \/&gt;<br \/>\n&lt;\/conditions&gt;<br \/>\n&lt;action type=\u201dRedirect\u201d redirectType=\u201dPermanent\u201d url=\u201dhttp:\/\/www.yourdomain.com\/{R:1}\u201d \/&gt;<br \/>\n&lt;\/rule&gt;<br \/>\n&lt;rule name=\u201dImported Rule 2\u2033 stopProcessing=\u201dtrue\u201d&gt;<br \/>\n&lt;match url=\u201d^(.*)$\u201d ignoreCase=\u201dfalse\u201d \/&gt;<br \/>\n&lt;conditions&gt;<br \/>\n&lt;add input=\u201d{REQUEST_FILENAME}\u201d matchType=\u201dIsFile\u201d ignoreCase=\u201dfalse\u201d negate=\u201dtrue\u201d \/&gt;<br \/>\n&lt;add input=\u201d{REQUEST_FILENAME}\u201d matchType=\u201dIsDirectory\u201d ignoreCase=\u201dfalse\u201d negate=\u201dtrue\u201d \/&gt;<br \/>\n&lt;add input=\u201d{URL}\u201d pattern=\u201d^\/favicon.ico$\u201d ignoreCase=\u201dfalse\u201d negate=\u201dtrue\u201d \/&gt;<br \/>\n&lt;\/conditions&gt;<br \/>\n&lt;action type=\u201dRewrite\u201d url=\u201dindex.php?_route_={R:1}\u201d appendQueryString=\u201dtrue\u201d \/&gt;<br \/>\n&lt;\/rule&gt;<br \/>\n&lt;\/rules&gt;<br \/>\n&lt;\/rewrite&gt;<br \/>\n&lt;\/system.webServer&gt;<br \/>\n&lt;\/configuration&gt;<\/p>\n<p>web.config code end<br \/>\nJust copy paste the above code in your web.config file and upload it on your server. Voila! SEO URL enabled.<br \/>\nNow for those nerds who need a bit of technical explanation.<br \/>\nThe first rewrite rule will helps in redirecting the website from naked domain to?<a href=\"http:\/\/www.domain\/\">www.domain<\/a>name. This is very good for Google SEO.<br \/>\nThe second re write rule will simply remove the index.php?_route_= and put the SEO key word of the category that you just entered.<br \/>\nSo enjoy Opencart and have a good day!<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u4f55\u4f7f\u7528Opencart\u7684\u4f2a\u9759\u6001\u529f\u80fd<\/p>\n<p>\u7b2c\u4e00\uff1a\u8981\u786e\u4fdd\u4f60\u7684appache\u670d\u52a1\u5668\u5f00\u542f\u4e86mod_rewrite\u3002\u5177\u4f53\u5982\u4f55\u5f00\u542f\u548c\u786e\u8ba4\u4f60\u7684apache\u662f\u5426\u542f\u7528\u4e86mod_rewrite<\/p>\n<p>\u7b2c\u4e8c\uff1a\u4fee\u6539\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684.htaccess.txt\u4e3a.htaccess\u6587\u4ef6\uff0c\u5728windows\u73af\u5883\u4e0b\u53bb\u6389.txt\u65f6\uff0c\u4f1a\u6709\u4e00\u4e2a\u9519\u8bef\u63d0\u793a\uff0c\u53ef\u4ee5\u6309\u7167\u5982\u4e0b\u65b9\u5f0f\u4fee\u6539\uff1a<\/p>\n<p>\uff081\uff09\u7528\u8bb0\u4e8b\u672c\u6253\u5f00\uff0c\u70b9\u51fb\u6587\u4ef6?C\u53e6\u5b58\u4e3a\uff0c\u5728\u6587\u4ef6\u540d\u7a97\u53e3\u8f93\u5165\u201d.htaccess\u201d\uff0c\u6ce8\u610f\u662f\u6574\u4e2a\u7eff\u8272\u90e8\u5206\uff0c\u4e5f\u5c31\u662f\u5305\u542b\u82f1\u6587\u5f15\u53f7\uff0c\u7136\u540e\u70b9\u51fb\u4fdd\u5b58\u5c31\u884c\u4e86\u3002<\/p>\n<p>\uff082\uff09\u8fdb\u5165cmd\u547d\u4ee4\u7a97\u53e3\uff0c\u901a\u8fc7cd\u5207\u6362\u5f53\u521a\u5efa\u7acbhtaccess.txt\u6587\u4ef6\u7684\u6587\u4ef6\u5939\uff0c\u7136\u540e\u8f93\u5165\u547d\u4ee4\uff1arename htaccess.txt .htaccess?\uff0c\u7136\u540e\u70b9\u51fb\u952e\u76d8Enter\u952e\u5373\u53ef\u3002<\/p>\n<p>\uff083\uff09\u901a\u8fc7ftp\u8fde\u63a5htaccess.txt\u6240\u5728\u6587\u4ef6\u5939\uff0c\u901a\u8fc7ftp\u8f6f\u4ef6\u91cd\u547d\u540d\u3002<\/p>\n<p>\u7b2c\u4e09\uff1a\u767b\u5f55\u540e\u53f0\uff0c\u627e\u5230\u7cfb\u7edf\u8bbe\u7f6e-&gt;\u5546\u5e97\u8bbe\u7f6e-&gt;\u670d\u52a1\u5668\u8bbe\u7f6e\u628a\u201c\u9ad8\u7ea7URL Rewrite&#8217;s:\u201d\u9879\u6539\u9009\u6210\u201c\u662f\u201d<\/p>\n<p>\u7b2c\u56db\uff1a\u6dfb\u52a0\u5546\u54c1\u6216\u8005\u680f\u76ee\u65f6\uff0c\u53ea\u8981\u586b\u5199\u201cSEO?\u5173\u952e\u5b57\u201d\uff0c\u5c31\u4f1a\u524d\u53f0\u770b\u5230\u8def\u5f84\u7531&#8221;index.php?route=xx\/xx&#8221;\u7684\u65b9\u5f0f\u53d8\u6210\u4e86<a href=\"http:\/\/www.xxxx.com\/\">www.xxxx.com\/<\/a>\u4f60\u586b\u5199\u7684seo\u5173\u952e\u8bcd\/.<\/p>\n<p>\u4ee5\u4e0a\u8bbe\u7f6e\u73af\u5883\u90fd\u662f\u5728windows\u4e0b\u7684xampp\u5305\u7684apache\u548copencart\u4e2d\u6587\u73af\u5883\u4e0b\u8fdb\u884c\u3002\u5176\u4ed6\u73af\u5883\u53c2\u8003\u8bbe\u7f6e\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<p>1\u3001\u5982\u679c\u4f60\u548c\u6211\u4e00\u6837\u662f\u5728\u672c\u5730\u4f7f\u7528xampp\u5305\u6d4b\u8bd5opencart\uff0c\u8bbf\u95eeopencart\u7684\u8def\u5f84\u662flocalhost\/opencart\uff0c\u90a3\u4e48\u505a\u597d\u4ee5\u4e0a\u8bbe\u7f6e\u540e\uff0c\u8bf7\u8bb0\u5f97\u4fee\u6539.htaccess\u6587\u4ef6\u4e2d\u7684\u201cRewriteBase \/\u201d\u4fee\u6539\u4e3a\u201cRewriteBase\/opencart\/\u201d\u5426\u5219\u4f1a\u51fa\u73b0\u627e\u4e0d\u5230\u5730\u5740\u7684\u95ee\u9898\u3002<\/p>\n<p>2\u3001\u5982\u679c\u662f\u5176\u4ed6\u95ee\u9898\uff0c\u8bf7\u67e5\u770b\u4f60\u7684apache\u7684log\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f2a\u9759\u6001\u5b9e\u73b0\u7684\u539f\u7406\u5c31\u662f index.php?act=about&amp;cid=1 \u5c06\u8fd9\u79cd\u5f62\u5f0f\u7684\u52a8\u6001\u8def\u5f84\u7528 ab\u2026 <span class=\"read-more\"><a href=\"https:\/\/web.jofar.cn\/?p=258\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12,5],"tags":[],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-cloud","category-server","category-practice-readme"],"_links":{"self":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=258"}],"version-history":[{"count":0,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=\/wp\/v2\/posts\/258\/revisions"}],"wp:attachment":[{"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.jofar.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}