Only homepage working correctly, 404 error on everything else
Only homepage working correctly, 404 error on everything else
Only homepage working correctly, 404 error on everything else
Try using this: if (!is_admin()) { add_rewrite_rule(‘([A-Za-z0-9])/([A-Za-z0-9])’, ‘index.php/product?subcategory=$1&product=$2’, ‘top’); add_rewrite_rule(‘([A-Za-z0-9])’, ‘index.php/categories/?cat=$1’, ‘top’); }
With some help (also asked on SO, as this wasn’t a strict WP question), and some testing, the following ended up working for me (added a slash just before the $ sign): RewriteRule ^galleries/(.*)/$ /portfolio/$1 [R=301,NC,L] As the galleries are actual directories, not files, they have a slash at the end: http://subdomain.example.com/galleries/headshots/ Here —^
In your .htaccess file, add this code below- Redirect 301 / http://mywebsite.com/blog/ Change mywebsite.com with your actual domain.
ModRewrite not working properly
I solved it. Apache server doesn’t allow VHosts pointing to outside /var/www. So I changed all (Document root AND Directory) to /var/www/site and it worked on all sites, with permalinks working fine.
Turns out the file was the problem, as @TheDeadMedic suspected. The permissions were 640. After changing them to 644, the problem was solved! Thanks for the help.
Found that solution useful I think, this is an expensive way to replace underscores with dashes. But this works at least in my test environment. The first rule replaces dashes one by one. The second rule then removes the prefix from the requested URL. RewriteBase / # replace underscores with dashes RewriteRule (.+?)_(.+) $1-$2 [R=302,L] … Read more
How to change permalink structure and keep permalinks for old posts
I solved my problem. All I needed was the WordPress Rewrite API. if( ! function_exists(‘theme_add_rewrite_rules’) ){ function theme_add_rewrite_rules(){ add_rewrite_rule( ‘^blog/([^/]+)/?$’, ‘index.php?name=$matches[1]’, ‘top’ ); } } add_action( ‘init’, ‘theme_add_rewrite_rules’); This solves how wordpress will parse the URL. Half of the problem is how to modify the posts so that the links will not include the /en/ … Read more