× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Why not just use something like this?
RedirectMatch permanent (.*)\.html$ http://mydomain.com$1.php

You could use the rewrite engine, but you shouldn't need to unless some
of the .html urls are not changing to .php urls. In that case rewrite
could be your best bet. If you wanted to only change the url to *.php if
the *.php url was valid, you could do something like this:

RewriteCond %{REQUEST_URI} (.*)\.html [NC]
RewriteCond %0.php -f
RewriteRule (.*)\.html $1.php [R,L]

Or if you want to change all .html urls to .php urls unless the .html
url exists you could do something like this:

RewriteCond %{REQUEST_URI} (.*)\.html [NC]
RewriteCond %{REQUEST_URI} !-f
RewriteRule (.*)\.html $1.php [R,L]

Joe Lee

>>> koldark@xxxxxxxxx 08/20/2004 09:17:16 >>>
This isn't directly related to iSeries, but maybe someone can still
help...

As a bit of history, I run a MovableType blog. Recently, I have
decided to create the pages as PHP instead of HTML, then I can do some
cooler things with my site. Well, now I am getting tons of 404 errors
in my logs because of this move. So, I would like have have any URL
with ".html" to be sent to the exact same name, but with ".php" for
the extension. So for example:

mydomain.com/mysite/mypage.html

would come out as

mydomain.com/mysite/mypage.php

or

mydomain.com/mypage.html --> mydomain.com/mypage.php

I would like this to be a redirect so can clean up many of my 404
errors I have been getting. I have been trying to look for examples
but haven't found any.

Any ideas?

-- 
Mike Wills
iSeries Programmer/Lawson Administrator
koldark@xxxxxxxxx 
http://www.koldark.net 
Want Gmail? Email koldark+gmail@xxxxxxxxx to get on my waiting list.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.