Welcome to WebmasterWorld Guest from 54.211.11.57

Forum Moderators: Ocean10000 & incrediBILL & phranque

Any Way to "rewrite" Perl Script Output?

     
7:11 pm on Feb 28, 2017 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3114
votes: 122


I've used a really nice sitemap generator for over a decade to help me control what pages/directories get listed. It is a perl script and lives in the cgi-bin. The site has changed to https and it still works fine except that it generates http: pages in the sitemaps, even though you can't load the page as http: in a browser.

I am tempted to add the rewrite rules that I have in the root directory, but because it is within a folder in the cgi-bin I am hesitant. It is not a "get" request, it does not even show anything in the logs when I force it to run (by deleting the existing sitemap) so I don't see htaccess rewrites as being the right fix.

The script is at example.com/cgi-bin/sitemap/ and this is the code in the root directory .htaccess that lets me force generation of a new sitemap.xml and sitemap.txt file when I visit example.com/sitemap.txt
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^sitemap\.(txt|xml)$ cgi-bin/sitemap/sitemap.pl [L]


The developer is long retired. I suppose I should look for a different solution but it is only for a few auxiliary pages on an otherwise WP site. Sooner or later I'll need to either fix or replace this little gem as other hobby/info type sites end up https too. Just asking here in case someone knows a way to instruct the script?
7:47 pm on Feb 28, 2017 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:Feb 7, 2017
posts: 56
votes: 2


How about put these straggler pages into WP and let the WP sitemap take care of it?
8:23 pm on Feb 28, 2017 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3114
votes: 122


Thanks, but if te page worked well in WPit would be there already. It is a page with a wide table of data. It is perfectly responsive as it is, (each row becomes a list at smaller widths) but within WP it follows the rest of the site's bootstrap settings. I don't want to have to create a custom functions file and template for one page. I can manually create the xml file far easier than coaxing this data to co-operate with WP/bootstrap and display correctly.

Besides, that wont help at all for the thousands of other old pages on other domains. :(
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members