{"id":114,"date":"2010-07-09T18:55:20","date_gmt":"2010-07-10T01:55:20","guid":{"rendered":"http:\/\/www.joesuttle.com\/techblog\/?p=114"},"modified":"2010-07-09T18:55:20","modified_gmt":"2010-07-10T01:55:20","slug":"cmsms-search-engine-friendly-urls","status":"publish","type":"post","link":"https:\/\/joesuttle.com\/techblog\/?p=114","title":{"rendered":"CMSMS Search Engine Friendly URLs"},"content":{"rendered":"<p>Remember those long and ugly URLs that show up sometime when you click on a link &#8211; like<\/p>\n<p><code>http:\/\/yourfamousdomain.com\/index.php?page=new_products<\/code><br \/>\nThe URL shows the question mark and all the code that has to follow, especially when you may have multiple layers or very long page names. That can be solved by turning on &#8220;mod_rewrite&#8221; in config.php in your CMSMS root directory. It also involves copying the htaccess.txt file from the CMS &#8220;doc&#8221; folder to the CMS root directory. Using &#8220;pretty URLs&#8221; will leave this in your browser location bar&#8230;<br \/>\n<code>http:\/\/www.yourfamousdomain.com\/new_products\/<\/code><\/p>\n<p>Let&#8217;s begin by opening &#8220;config.php&#8221; and making our changes. In the &#8220;URL Settings&#8221; section, find the following line<br \/>\n<code>$config['url_rewriting'] = 'none';<\/code><br \/>\nand change &#8220;none&#8221; to &#8220;mod_rewrite&#8221;<br \/>\nThen where <code>$config['page_extension'] = '\/';<\/code> is, change the <code>''<\/code> to <code>'\/'<\/code>. This will add a forward slash at the end of your URL. Save and close your editor.<\/p>\n<p>Now, copy \/Doc\/htaccess.txt to your root directory and rename the file &#8220;.htaccess&#8221; Note the DOT before htaccess. It has to be that way for Apache to find it. It is no longer htaccess.txt! In .htaccess, make sure that if you have installed CMS in a subdirectory, to find<br \/>\n<code>RewriteBase \/<\/code><\/p>\n<p>and change the \/ to something like this:<br \/>\n<code>RewriteBase \/mycmsdirectory<\/code><br \/>\nDo not follow the directory name with a forward slash &#8211; leave it open!<\/p>\n<p>Make sure that in your Apache &#8220;httpd-vhosts.conf&#8221; that the entry for your DocumentRoot looks like this:<\/p>\n<p><code> &lt;Directory \"\/users\/myfabulousdomain\/htdocs\"&gt;<\/code><br \/>\n<code> Options FollowSymLinks<\/code><br \/>\n<code> AllowOverride All<\/code><br \/>\n<code> Order deny,allow<\/code><br \/>\n<code> allow from all<\/code><br \/>\n<code> Satisfy all<\/code><br \/>\n<code>&lt;\/Directory&gt;<\/code><\/p>\n<p>the &#8220;FollowSymLinks&#8221; is very important for &#8220;Pretty URLs&#8221;, as is &#8220;allow from all&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remember those long and ugly URLs that show up sometime when you click on a link &#8211; like http:\/\/yourfamousdomain.com\/index.php?page=new_products The URL shows the question mark and all the code that has to follow, especially when you may have multiple layers &#8230; <a class=\"more-link\" href=\"https:\/\/joesuttle.com\/techblog\/?p=114\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[24,25],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-cmsms","tag-cmsms","tag-friendly-urls"],"_links":{"self":[{"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=114"}],"version-history":[{"count":0,"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joesuttle.com\/techblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}