KiltedMike Posted March 17, 2012 Share Posted March 17, 2012 I've searched and read 'til my head is spinning, but I just can't find an answer to this situation. It has to have been discussed many times before...I just can't find it: I have a large number of html pages that have been converted to php (MySQL database), such as: 123.html becoming EventRecord.php?Id=123 I also have many static html pages remaining. Is it possible to filter a mod_rewrite so that it only rewrites URLs that are numeric? 1.html to 9999.html and nothing else? The idea, of course, is to have these as 301 redirects. Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/259111-conditional-rewrites/ Share on other sites More sharing options...
AyKay47 Posted March 17, 2012 Share Posted March 17, 2012 this is basic pseudo code. and I'm a little rusty with rewrites. RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} -f RewriteCond %{SCRIPT_FILENAME} \.html RewriteRule (\d){,4}\.html $1.php [R=301] Shouldn't need anything too complex for this, based off of your OP. Quote Link to comment https://forums.phpfreaks.com/topic/259111-conditional-rewrites/#findComment-1328398 Share on other sites More sharing options...
KiltedMike Posted April 16, 2012 Author Share Posted April 16, 2012 Took a long time trying to understand this, but I'm not gonna get there. I've never needed mod_rewrite before and the odds are -- at 58 -- I'll die without needing it again. Is there some place where I can hire someone to do this? It should be a 5 minute piece of cake for someone who knows this stuff, but I have spent far too much time trying to learn it for the small need I have. My time needs to be spent finding a new position since I've been laid off. Appreciate the answer I got...just can't get from there to where I need to be. Quote Link to comment https://forums.phpfreaks.com/topic/259111-conditional-rewrites/#findComment-1337906 Share on other sites More sharing options...
AyKay47 Posted April 17, 2012 Share Posted April 17, 2012 the freelance section is there to either find work or to find someone to do the work for you. Quote Link to comment https://forums.phpfreaks.com/topic/259111-conditional-rewrites/#findComment-1338069 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.