DarkWater Posted June 12, 2008 Share Posted June 12, 2008 Where do you have this located? It's in the main folder, correct? Link to comment https://forums.phpfreaks.com/topic/109796-link-hijacking/page/2/#findComment-564368 Share on other sites More sharing options...
suntracker Posted June 12, 2008 Author Share Posted June 12, 2008 /httpdocs/index.php /httpdocs/.htaccess /httpdocs/mediawiki/ The two rules you made for me yesterday work just fine: RewriteRule ^mediawiki/index.php/(.+)$ index.php?wiki=$1 [R=301] RewriteRule ^mediawiki/index.php/(.+)/$ index.php?wiki=$1 [R=301] Except it operates on URL's of the form /mediawiki/index.php/Desired_Page instead of /mediawiki/index.php?title=Desired_Page RewriteRule ^mediawiki/index.php?title=(.+)$ index.php?wiki=$1 [R=301] does not work on http://foo.com/mediawiki/index.php?title=Desired_Page Link to comment https://forums.phpfreaks.com/topic/109796-link-hijacking/page/2/#findComment-564371 Share on other sites More sharing options...
DarkWater Posted June 12, 2008 Share Posted June 12, 2008 Here: RewriteRule ^mediawiki/index\.php\?title=(.+)$ index.php?wiki=$1 [R=301] Link to comment https://forums.phpfreaks.com/topic/109796-link-hijacking/page/2/#findComment-564376 Share on other sites More sharing options...
suntracker Posted June 12, 2008 Author Share Posted June 12, 2008 I had already tried that. There must be something else wrong here... something we're not seeing. Link to comment https://forums.phpfreaks.com/topic/109796-link-hijacking/page/2/#findComment-564379 Share on other sites More sharing options...
suntracker Posted June 17, 2008 Author Share Posted June 17, 2008 After much frustration I now have code to do what I want: Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} !^(.*&)action=submit(&.*)?$ [NC] RewriteCond %{QUERY_STRING} !^(.*&)?mod_rewrite=no(&.*)?$ [NC] RewriteCond %{QUERY_STRING} ^(.*&)?title(=.+)$ [NC] RewriteRule ^mediawiki/index\.php$ /index.php?%1wiki%2 [R=301,L] RewriteRule ^mediawiki/index\.php/(.*[^/])/?$ /index.php?wiki=$1 [R=301,L] Link to comment https://forums.phpfreaks.com/topic/109796-link-hijacking/page/2/#findComment-566917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.