Forum Moderators: phranque
(where ptid is publication type and it is permanently set to 1 and # stnads for article #s 1-2,500)
to article#.html
anyone have any thoughts?
RewriteRule ^article([^/]+).html$?module=articles&func=display&ptid=1&aid=$1
But what comes before the "?"?"
Sorry, it would be domain.com/
I was refering to the string that comes out when you click on an article link.
Why htm rather than and html extension?
I'm trying to upgrade my site with a new CMS and have to have the exact urls as the current site so as to avoide duplicate content issues.
The steps typicially go like this:
The second and third step use mod_rewrite. But they aren't useful unless your script does step one. In many cases, this is easy to do, even if the URLs are taken from a database -- You can use the PHP preg_replace function, for example, to convert unfriendly URLs to friendly form while generating a page, and so 'publish' only friendly URLS on your pages.
It often helps to point out that mod_rewrite processes URLs as they arrive in requests at your server. It works in the URL-to-filepath translation API phase before any content is served and before any scripts are invoked. It has no capability to modify the output content of your pages.
Jim
The new CMS I'm testing out had a baked in short url that I had to turn off two times at two different places. I also had to omit the first bit of rewrite code in .htaccess that got rid of an index.php the CMS added automatically.
After all that fuss, my original rewrite worked:)