why doesn’t my rewrite rule work? (is there something weird with wordpress htaccess?)

Sooo the problem was my brackets around the content in the condition I think. I’m still not so hot on these things, but I use these rules and they work: RewriteCond %{REQUEST_URI} ^/(review|preview|feature).*\-[0-9]+$ RewriteRule ^review/(.*)\-[0-9]+$ /$1 [R=301,L] RewriteRule ^preview/(.*)\-[0-9]+$ /$1 [R=301,L] RewriteRule ^feature/(.*)\-[0-9]+$ /$1 [R=301,L] note: the (review|preview|feature) but is an x OR y OR … Read more

1 WordPress, 2 themes, 2 domains, 2 servers

I can think of 2 approaches to try: You can use a referrer variable within the link such as: domain-two.net/blog/?ref=blog2 The receiving blog should watch out for the content of the ref variable. You can just copy domain-one.com into domain-two.net/blog, then access the database of domain-one.com remotely via wp-config.php

What is the importance of mod_rewrite?

the Redirect directive is part of Apache’s mod_alias, not mod_rewrite. mod_rewrite enables “pretty” permalinks, ie: http://yourdomain.com/a-post-title/ rather than “ugly” permalinks ie:http://yourdomain.com/?p=99. WordPress will operate just fine without mod_rewrite and pretty permalinks, it’s just not as attractive or SEO friendly.

WordPress and Htaccess

‘RewriteBase /’ is not needed. RewriteBase allows you to change your internal directory structure to something other than what a browser sees. IE: If all your files are in ‘http://mydomain.com/site’, but you wanted ‘http://mydomain.com’ to be the path browsers see, you would use a RewriteBase /site and apache’s mod_rewrite would happily add that substitution for … Read more

mod_rewriting conflict with WP permalinks in htaccess [closed]

Try this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_URI} ^/blog/.*$ RewriteRule /blog/?c=([^\&]*) $1 [L] # BEGIN WordPress RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] # END WordPress </IfModule> Since RewriteBase is defined, you shouldn’t have to specify /blog/ again in the redirection part. RewriteEngine On and RewriteBase … Read more

WordPress .htaccess rewrite for custom template

Don’t use an .htaccess rule, use WordPress internal rewrite system. First, add a query var for your ID: function wpd_query_vars( $query_vars ){ $query_vars[] = ‘my_id’; return $query_vars; } add_filter(‘query_vars’, ‘wpd_query_vars’); Then add an internal rule to catch incoming requests, load your database page, and set the ID query var: function wpd_database_rewrites(){ add_rewrite_rule( ‘database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$’, ‘index.php?pagename=database&my_id=$matches[1]’, ‘top’ … Read more