<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: URL rewrite</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: URL rewrite</description>
<language>en</language>
<pubDate>Wed, 03 Jun 2026 19:32:32 +0000</pubDate>

<item>
<title>mlykke on "URL rewrite"</title>
<link>https://www.machform.com/forums/topic/url-rewrite#post-10879</link>
<pubDate>Thu, 18 Nov 2010 05:34:25 +0000</pubDate>
<dc:creator>mlykke</dc:creator>
<guid isPermaLink="false">10879@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I never took the time to work through the coding needed to implement my proposed suggestion and settled with the more handmade way of manually creating a subfolder for aech form with the form name and an index file inside it containing the advanced embed code as proposed by yuniar.&#60;/p&#62;
&#60;p&#62;This topic can be closed, I think.
&#60;/p&#62;</description>
</item>
<item>
<title>mlykke on "URL rewrite"</title>
<link>https://www.machform.com/forums/topic/url-rewrite#post-10265</link>
<pubDate>Mon, 23 Aug 2010 21:17:38 +0000</pubDate>
<dc:creator>mlykke</dc:creator>
<guid isPermaLink="false">10265@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Yuniar,&#60;/p&#62;
&#60;p&#62;I'm not really having any result with your first suggestion.&#60;/p&#62;
&#60;p&#62;When I try to access &#60;a href=&#34;http://www.example.com/forms/23/my-form-title-here/,&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/forms/23/my-form-title-here/,&#60;/a&#62; I get a 404/Not Found - obviously because the directory isn't there.&#60;/p&#62;
&#60;p&#62;Also, there must be a problem with accessing $_GET[&#34;form_id&#34;], since there is no ?form_id=23 in the url?&#60;/p&#62;
&#60;p&#62;And even if I add that parameter to the url, like &#60;a href=&#34;http://www.example.com/forms/23/my-form-title-here/?form_id=23,&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/forms/23/my-form-title-here/?form_id=23,&#60;/a&#62; I get mysql-query error Access denied for user 'SYSTEM'@'localhost' (using password: NO) [..] on line 18. User SYSTEM?? Where does that come from?&#60;/p&#62;
&#60;p&#62;I'v been working with something like having a file called 'form' (no .php-extension) but with php-code in it. And then in my .htaccess file I have:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;FilesMatch &#38;quot;form&#38;quot;&#38;gt;
	ForceType application/x-httpd-php
&#38;lt;/FilesMatch&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;...which will make Apache treat the file like a php file.&#60;/p&#62;
&#60;p&#62;In the file form (without .php), I parse the url and set $_GET[&#34;form_id&#34;] according to the url.&#60;/p&#62;
&#60;p&#62;Then I can do &#60;a href=&#34;http://www.example.com/form/1/test/&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/form/1/test/&#60;/a&#62; - except that this screws up css and js files paths... I'm currently working on a work-around (editing your code ;-))&#60;/p&#62;
&#60;p&#62;I would like it to end up with &#60;a href=&#34;http://www.example.com/form/test/&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/form/test/&#60;/a&#62; and then set the form id by querying the db for the id of the form named 'test'.&#60;/p&#62;
&#60;p&#62;If I get it to work, I'll post the code (or email you it).&#60;/p&#62;
&#60;p&#62;Your second suggestion might work but the url would still just be an integer and not the form title (which is what I would like it to be).&#60;/p&#62;
&#60;p&#62;Thanks a lot for your help!&#60;/p&#62;
&#60;p&#62;/Michael
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "URL rewrite"</title>
<link>https://www.machform.com/forums/topic/url-rewrite#post-10258</link>
<pubDate>Mon, 23 Aug 2010 06:09:06 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">10258@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I haven't test this yet, but you might be able doing it using this rewrite rule:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;RewriteRule ^forms/([0-9]+)(.*)/(.*)$ forms/index.php?form_id=$1&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>yuniar on "URL rewrite"</title>
<link>https://www.machform.com/forums/topic/url-rewrite#post-10257</link>
<pubDate>Mon, 23 Aug 2010 06:03:38 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">10257@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Let say you have machform installed under &#34;myforms&#34; folder. I suggest to create another folder called &#34;forms&#34;.&#60;/p&#62;
&#60;p&#62;Under &#34;forms&#34; folder, you can create an index.php file, which contains your form embed code, using the advanced form code, like this for example:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
	require(&#38;quot;/var/html/machform/machform.php&#38;quot;);
	$mf_param[&#38;#39;form_id&#38;#39;] = (int) $_GET[&#38;#39;form_id&#38;#39;];
	$mf_param[&#38;#39;base_path&#38;#39;] = &#38;#39;http://localhost/machform-test/&#38;#39;;
	display_machform($mf_param);
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see, the &#34;form_id&#34; is being fetched from the GET parameter. This is where the rewrite need to do the job.&#60;/p&#62;
&#60;p&#62;So, you can have an URL like this:&#60;br /&#62;
&#60;a href=&#34;http://www.example.com/forms/23/my-form-title-here/&#34; rel=&#34;nofollow&#34;&#62;http://www.example.com/forms/23/my-form-title-here/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;and you only need to pass the id number (23 in this sample) to load the form properly, while the title is whatever you like.
&#60;/p&#62;</description>
</item>
<item>
<title>mlykke on "URL rewrite"</title>
<link>https://www.machform.com/forums/topic/url-rewrite#post-10251</link>
<pubDate>Fri, 20 Aug 2010 20:36:25 +0000</pubDate>
<dc:creator>mlykke</dc:creator>
<guid isPermaLink="false">10251@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi all&#60;/p&#62;
&#60;p&#62;I couldn't find any posts about getting clean urls, like this &#60;a href=&#34;http://www.mysite.com/myforms/apply/&#34; rel=&#34;nofollow&#34;&#62;www.mysite.com/myforms/apply/&#60;/a&#62; instead of &#60;a href=&#34;http://www.mysite.com/myforms/view.php?id=1.&#34; rel=&#34;nofollow&#34;&#62;www.mysite.com/myforms/view.php?id=1.&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I would like to add this functionality.&#60;/p&#62;
&#60;p&#62;I plan on adding a db table called urls with fields form_id and url_segment and then adding php code that turns '/apply/' into 'id=1' and vice versa.&#60;/p&#62;
&#60;p&#62;I think i will be able to add the insert statement when you create a new form but I'm a little unsure whether it's possible to somehow make the conversion in a separate file where I just put $input_array['form_id'] = 1, for example?&#60;/p&#62;
&#60;p&#62;I know it's possible to make rewriting in server setup and .htaccess file but I would like to make this functionality dynamic. What are you're thoughts about this?&#60;/p&#62;
&#60;p&#62;Thanks for an otherwise great app!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
