I gave a URL for a page on my site (http://hyc.org/directions/car) to somebody to publish in their newsletter. They apparently decided they knew better, and "corrected" the URL to have a ".html" on the end, i.e. published "http://hyc.org/directions/car.html". Now they call me up saying their members can't get to our web site.
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
-- roy@panix.com
Apache??? Do not place this into a live site, I have not tested it. I am just thinking out loud, but what about something like this?
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*).html$ $1
Craig Jackson
On Thu, May 1, 2008 at 8:55 AM, Roy Smith roy@panix.com wrote:
I gave a URL for a page on my site (http://hyc.org/directions/car) to somebody to publish in their newsletter. They apparently decided they knew better, and "corrected" the URL to have a ".html" on the end, i.e. published "http://hyc.org/directions/car.html". Now they call me up saying their members can't get to our web site.
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
-- roy@panix.com
-- [ Drupal support list | http://lists.drupal.org/ ]
Aonther idea - use the path module to create an alias to car.html to point to the node/path that you need IT won't do it for all, but it should get you out of your current jam.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Craig Jackson Sent: Thursday, May 01, 2008 8:01 AM To: support@drupal.org Subject: Re: [support] Getting rid of ".html" suffix in URL?
Apache??? Do not place this into a live site, I have not tested it. I am just thinking out loud, but what about something like this?
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*).html$ $1
Craig Jackson
On Thu, May 1, 2008 at 8:55 AM, Roy Smith roy@panix.com wrote:
I gave a URL for a page on my site (http://hyc.org/directions/car) to somebody to publish in their newsletter. They apparently decided
they
knew better, and "corrected" the URL to have a ".html" on the end, i.e. published "http://hyc.org/directions/car.html". Now they call
me
up saying their members can't get to our web site.
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
-- roy@panix.com
-- [ Drupal support list | http://lists.drupal.org/ ]
Further, the pathauto module should allow you to maintain a consistent ".html" naming scheme across nodes, should you go this route.
Brian
Metzler, David wrote:
Aonther idea - use the path module to create an alias to car.html to point to the node/path that you need IT won't do it for all, but it should get you out of your current jam.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Craig Jackson Sent: Thursday, May 01, 2008 8:01 AM To: support@drupal.org Subject: Re: [support] Getting rid of ".html" suffix in URL?
Apache??? Do not place this into a live site, I have not tested it. I am just thinking out loud, but what about something like this?
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*).html$ $1
Craig Jackson
On Thu, May 1, 2008 at 8:55 AM, Roy Smith roy@panix.com wrote:
I gave a URL for a page on my site (http://hyc.org/directions/car) to somebody to publish in their newsletter. They apparently decided
they
knew better, and "corrected" the URL to have a ".html" on the end, i.e. published "http://hyc.org/directions/car.html". Now they call
me
up saying their members can't get to our web site.
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
-- roy@panix.com
-- [ Drupal support list | http://lists.drupal.org/ ]
I would second using an apache rewrite rule so it's more generalized, and not cluttering up your database and aliases list. I'm no expert on the syntax of these either though, although the one proposed seems reasonable at first glance at least - would have to check through documentation to be sure. Meanwhile, I'd also be having some "less than pleased" conversations with the incompetent person at the publisher...
On 5/1/08, Roy Smith roy@panix.com wrote:
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
All URLs probably would require a solution at the Apache level, but if it's just for the one URL (or a handful) then http://drupal.org/project/path_redirect could help.
Regards, Greg
Quoting Roy Smith roy@panix.com:
I gave a URL for a page on my site (http://hyc.org/directions/car) to somebody to publish in their newsletter. They apparently decided they knew better, and "corrected" the URL to have a ".html" on the end, i.e. published "http://hyc.org/directions/car.html". Now they call me up saying their members can't get to our web site.
Is there any way to make drupal treat the .html URL as an alias for the correct one? More generally, is there a way to make it do so for *all* URLs that end in .html?
It has been suggested both apache rewrite rule and autopath. Autopath would create more overhead with DB selects. For that reason a rewrite rule may be better but autopath would allow you to change the redirection URL for one specific item if you need it.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/