They are very different things, even if the code only differs by a few characters.
Let's see your code, and details as to what happens when you use it.
Mark1978
1:06 pm on May 20, 2010 (gmt 0)
Hi Sorry, I probably need to be a bit clearer.
It needs to be a rewrite. As shown below
http://www.example.com/showreel/index/php To http://www.example.com/4-showreel.html
The showreel section that I created is not dynamically created by the CMS. Hence that's why it has a different url. The sections are numbered and named by the CMS and then given a .html extension via .htaccess
Does this make sense? I just want it follow the same convention as the rest of the site.
Thanks
jdMorgan
2:12 pm on May 20, 2010 (gmt 0)
Part of the confusion is mixing-up URLs (used out on the Web) with filepaths (used inside the server).
Another part of the confusion is this, specifically the italicized part: > The sections are numbered and named by the CMS and then given a .html extension via .htaccess
.htaccess does not and cannot do this as described. What .htaccess can do is to take a client request for the client-requested URL http://www.example.com/4-showreel.html and rewrite that request to the script filepath /showreel/index.php (note no protocol or domain on filepath).
So step one is to modify the links and object references on your pages to refer to .html URLs, and step two is to write a rewriterule to "connect" those URLs to the script file at /showreel/index.php
An optional step three is to redirect direct client requests for the script filepath (filepath used as a URL) to the correct .html URL. This must be done last, after everything else is tested and working.
And finally, an additional option is to get rid of the superfluous ".html" extensions on your URLs, since they do nothing whatsoever out on the Web but waste bytes. Extensionless URLs such as http://www.example.com/4-showreel would work just fine.
Anyway, the bottom line is that whatever URL you want to appear in the browser address bar and in search engine results listings is the URL you must link to on your pages. Pages define URLs, and once a URL is published, mod_rewrite in .htaccess cannot change it.