[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-cleaner-fw1-subsystem-url-with-apache-mod-rewrite":3},{"id":4,"title":5,"body":6,"date":89,"description":12,"extension":44,"meta":90,"navigation":91,"path":92,"published":91,"seo":93,"slug":94,"stem":95,"summary":5,"tags":96,"__hash__":100},"blog/blog/2013-05-22-cleaner-fw1-subsystem-url-with-apache-mod-rewrite.md","Cleaner FW/1 Subsystem URL With Apache Mod_Rewrite",{"type":7,"value":8,"toc":87},"minimark",[9,13,16,19,22,30,36,39,77,80,83],[10,11,12],"p",{},"This is more of a reference for myself but if anyone is as bad as I am at URL rewriting (and regex for that matter) then this could be of some help.",[10,14,15],{},"I use Apache for my dev and production so naturally when I'm looking to do SES URLs I'm digging into mod_rewrite. In the most general of uses, I usually go searching for examples that relate to my given scenario; which is pretty straight forward as far as what I'm trying to do. Someone has had to have done it. Typically when I search the almighty Google I use a reference to PHP for the sake of getting as many examples as I can.",[10,17,18],{},"In the case of this site for example, when I wanted to do some rewriting, I searched in relation to Mango Blog and found some forum/blog posts; copied them and bended them as I needed and all was well.",[10,20,21],{},"With FW/1 I had been trying to rewrite subsystem URLs for a while on my own; and was failing miserably with no solid result. Now of course, I could have reached out to the community or Google Groups in regards to this but I was really trying to grasp this on my own. In the end I used a makeshift of a rewrite I use with the URLs on this site.",[10,23,24,25,29],{},"As an example, what I could be working with would look like this - ",[26,27,28],"code",{},"http://mysite.com/index.cfm/admin:main",".",[10,31,32,33,29],{},"I'm a bit anal about the \"index.cfm\" and the \":\". I wanted to remove both and make the URL look like this - ",[26,34,35],{},"http://mysite.com/admin/main",[10,37,38],{},"This is what did the trick:",[40,41,46],"pre",{"className":42,"code":43,"language":44,"meta":45,"style":45},"language-md shiki shiki-themes github-light github-dark github-dark monokai","RewriteEngine On\nRewriteRule ^admin/(.\\*)$ index.cfm/admin:$1 [L]\n","md","",[26,47,48,57],{"__ignoreMap":45},[49,50,53],"span",{"class":51,"line":52},"line",1,[49,54,56],{"class":55},"s__4a","RewriteEngine On\n",[49,58,60,63,67,70,74],{"class":51,"line":59},2,[49,61,62],{"class":55},"RewriteRule ^admin/(.",[49,64,66],{"class":65},"s-7EV","\\*",[49,68,69],{"class":55},")$ index.cfm/admin:$1 [",[49,71,73],{"class":72},"smDfC","L",[49,75,76],{"class":55},"]\n",[10,78,79],{},"Now this might have seemed simple to some but I am a complete noob to the matter; and the fact that I got something working is a big deal even if it was as plain as this might actually be.",[10,81,82],{},"Anyway, happy coding.",[84,85,86],"style",{},"html pre.shiki code .s__4a, html code.shiki .s__4a{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .s-7EV, html code.shiki .s-7EV{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF}html pre.shiki code .smDfC, html code.shiki .smDfC{--shiki-light:#032F62;--shiki-light-text-decoration:underline;--shiki-default:#DBEDFF;--shiki-default-text-decoration:underline;--shiki-dark:#DBEDFF;--shiki-dark-text-decoration:underline;--shiki-sepia:#AE81FF;--shiki-sepia-text-decoration:inherit}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":45,"searchDepth":59,"depth":59,"links":88},[],"2013-05-22",{},true,"/blog/2013-05-22-cleaner-fw1-subsystem-url-with-apache-mod-rewrite",{"title":5,"description":12},"cleaner-fw1-subsystem-url-with-apache-mod-rewrite","blog/2013-05-22-cleaner-fw1-subsystem-url-with-apache-mod-rewrite",[97,98,99],"ColdFusion","FW1","Apache Mod_Rewrite","2uL8V0PUg-D88lY3wBUjS5kSSPVACcnJQlLnJYKdLdg"]