Helmet Posted March 27, 2009 Share Posted March 27, 2009 Hi, Google Webmaster tools is telling me I have a bunch of 404's probably due to a previous botched rewrite (since fixed) but I'd like to fix the 404's now. The URL's look like this directory1/directory2//file.php?id=3898 and I'd like to redirect to directory1/directory2/3898/ It's that double slash in there I think. This is not working: RewriteCond %{QUERY_STRING} ^id=([0-9]*)$ RewriteRule ^([^/]+)directory2//file\.php$ /$1/directory2/%1/? [R=301,NC,L] Is there something I'm missing? Thx, Helm Link to comment https://forums.phpfreaks.com/topic/151321-solved-very-specific-screwy-url-i-need-to-rewrite/ Share on other sites More sharing options...
Helmet Posted April 6, 2009 Author Share Posted April 6, 2009 Resolved it with this: RewriteCond %{REQUEST_URI}?%{QUERY_STRING} ^(.*)/(.*)//(.*)\.php\?id=([0-9]*)$ RewriteRule . %1/%3/%4/? [R=301,L] Link to comment https://forums.phpfreaks.com/topic/151321-solved-very-specific-screwy-url-i-need-to-rewrite/#findComment-802573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.