You can add extra rules right after the ^index\.php$
line via the WP_Rewrite
class, more specifically the add_external_rule()
method. They are added to the non_rewrite_rules
array, which is written in the mod_rewrite_rules()
method.
This is a very simple example. You should still flush the rewrite rules (once), either on plugin activation or by visiting the Permalinks page.
add_action( 'init', 'wpse9966_init' );
function wpse9966_init()
{
global $wp_rewrite;
// The pattern is prefixed with '^'
// The substitution is prefixed with the "home root", at least a "https://wordpress.stackexchange.com/"
$wp_rewrite->add_external_rule( 'images/thumb/(.*)$', 'timthumb.php?filename=$1' );
}
Related Posts:
- How to create custom 401, 403 and 500 error pages?
- How to export/import theme customizer settings?
- PHP – redirect https to http and www to non-www
- Site Title and Tagline in Theme Options Page
- reason of splitting theme files to multiple files
- Editor role cannot save custom theme options
- wp_customize_image_control default value
- Bypass .htaccess when using download_url
- Site Title and Tagline in Pagelines DMS Options Panel
- How can I run a .php file located in my site’s root folder?
- Fix 403 error on WordPress multisite network using subdomains
- How to redirect all 404 in a WordPress subdirectory to the index.php of subdirectory?
- How to run multiple websites from single WordPress setup
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- WordPress-site can be reached on x.x.x.x/index.php – but not directly on the IP without index.php
- How can one utilize a variable as a callback function name for add_settings_field
- theme options echoing multiple times
- Theme Options: If There is No Input, Don’t Display?
- Change the actual (or viewable) WordPress directory structure
- Add htaccess rules with insert_with_markers at beginning of htaccess
- Displaying theme options in css
- Putting PHP variables into javascript [duplicate]
- Choose To Display Post Views With An Options Panel
- Set WordPress Default Template
- Cannot get media type from ‘x-mapp-php5’
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Set the checkbox as checked by default at options page
- Customizer – Prefix Class Extension
- Theme Options Page – User Updates Logo
- How to change home or site url using action hooks or filter?
- Apache Fallback instead of add_rewrite_rule
- 3 blogs same installation, without WP MU
- Selectbox in admin panel function linking to CSS
- Using if/else statements with output from theme options
- Two Different Links for Same Product – WooCommerce [closed]
- Was told to change the .htacess file form .html to .php so this would work properly
- WP Post-Thumbnail
- How to change redirection route to a php page for making it only accessible by logged-in members?
- how to combine wordpress htaccess on my root domain + php on subfolder
- subdirectory index.php is not working
- custom url rewrite for wordpress
- Loading index.php contents which located outside blog folder for post single page
- Error: options page not found
- WP & Server Speed [Teacher Question]
- WordPress theme options error
- WordPress add_rewrite_rules for custom URLs ending in .html
- WordPress Options Page Theory Question
- Troll the hackers by redirecting them
- Warning: Illegal string offset on theme options page [closed]
- Changing the color scheme based on the url visited
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Link blogname and blogdescription to the Options Framework
- How to add drag and drop functionalities to a div inside option panel
- Seo Friendly Filter URLs
- How to allow download url redirection only if user logged in WordPress site?
- How to disable all logins except Network login in WordPress Multi site?
- Undefined index for default custom theme option
- Removing files programmatically
- Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
- PHP if have image display image, if else text
- Php file that doesn’t recognize wordpress functions
- Deactivate a plugin on wp version
- Simple seo-friendly custom $_GET url rewrite with htaccess
- what does $options = get_option(‘test_theme’); do?
- Using theme options to change a border-radius value
- How to make Subdomain work for product_tag?
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Illegal string offset in PHP function in via Theme Customizer
- How to serve WordPress folder over subdomain?
- Pages from admin dasboard missing after site migration
- Rewrite rule not working, but only when parameter is text
- Internal Server Errors – Moving working multi-site install to my localhost
- Change CSS Variable value in Theme Customizer Live Preview
- How to find php variable of wordpress theme settings
- Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
- How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
- How to block access to a folder inside of wp-content for non logged in users?
- WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page
- How to change query string with pretty URL in WordPress using .htaccess file
- Upload images from one server to an other in wordpress
- Problem with ajax request and directory structure after site migration
- How can I add “.html” to the end of a single URL on a WordPress website?
- Resource 404 error on multisite subdirectory install
- redirect 301 with special character like WIX site “#!”
- 301 redirect from webpage to wordpress page in the same root
- Rewrite /keyword1+keyword2.html to search page | .htaccess
- Redirect homepage /page/1/ to /blog/page/1/
- wp_customize_image_control default value
- WordPress Setting page can not be saved by html radio
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- Why I can download any file except PHP files from a URL but I can download any from another site?
- 3 domains, 1 wordpress install, redirecting and changing domains on live site
- Not able to call class in NHP framework
- Category List in Theme Options Page
- How to change a specific character in a theme option value – replace a space with a plus sign
- Setting field not saving on front-end
- Select area and checkbox data is not saving?
- Options.php loop won’t show!
- How to use multiple 404 Error Pages in WordPress
- Increase Upload Size with htaccess | MAMP