This plugin is outdated and might not be supported anymore
Absolute-to-Relative URLs

Absolute-to-Relative URLs

Details
View on WordPress

If you were to use this on a website like http;//example.com/test/testing/, you would get results like these:

    • Before: http;//example.com/test/another-test/#anchor
    • After: ../another-test/#anchor
    • Before: http;//example.com/wp-content/themes/twentyten/style.css
    • After: /wp-content/themes/twentyten/style.css
    • Before: https;//example.com/wp-content/themes/twentyten/style.css
    • After: https;//example.com/wp-content/themes/twentyten/style.css
    • Before: http;//google.com/test/
    • After: //google.com/test/
    • Before: ../../../../../../../../#anchor
    • After: /#anchor
    • After ($output_type=1): ../../#anchor

All string parsing. No directory browsing.

If you’re looking for a plugin that will automatically convert all URLs on your WordPress site, instead check out my other plugin, WP-HTML-Compression.
Before you copy this code and add it into your own, keep in mind that there will probably be future updates. Keeping the code within an installed plugin will make sure that you’re notified.

Details

Plugin code:
absolute-to-relative-urls
Plugin version:
0.3.4
Outdated:
Yes
WP version:
3.2 or higher
PHP version:
or higher
Test up to WP version:
3.4.2
Total installations:
20
Last updated:
2013-03-28
Rating:
Times rated:
2
absolute
function
link
links