Rewrite rule never matching

Please try this. First add the rewrite rule you need with this function add_action( ‘init’, ‘rewrite_site_tools_page’ ); function rewrite_site_tools_page() { add_rewrite_rule( ‘^site-tools-([^/]+)$’, ‘index.php?pagename=site-tools&tool=$matches[1]’, ‘top’); } Assuming that page name is site-tools. Now add the tool as query var add_filter(‘query_vars’, ‘wpd_query_vars’); function wpd_query_vars( $query_vars ){ $query_vars[] = ‘tool’; return $query_vars; } Save permalinks. Now if you … Read more

removing index.php IIS 7.5 webconfig

After struggling for a while in the web.config structure. I found out we need to clear the rule before to add another rule. Just add tag </clear> <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <clear/> <rule name=”wordpress” patternSyntax=”Wildcard”> <match url=”*”/> <conditions> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true”/> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true”/> </conditions> <action type=”Rewrite” url=”index.php”/> </rule> </rules> … Read more

Rewrite rule not working

If this address already gets traffic (from inbound links etc.) why don’t you try a good old fashioned redirect like this: Redirect 301 /sca/project_0 http://www.yourdomain.com/sca?urn=project_0 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Or use the 301 redirect in … Read more

Move wordpress to folder without changing urls

Method 1: You can export your data from “Tools > Export” and for ensure export from database and rename old blog folder, then install WordPress in root & active WordPress Network. set url structure for new blog to sub-folder. now create new blog with “blog” name, login to blog & import old blog data. Your … Read more

Two “.htaccess” Files Located in Different Directories?

In general, Apache will use the most specific .htaccess to the resource being requested. This means that, for accessing files in /httpdocs/wordpress/, /httpdocs/wordpress/.htaccess will be used. Access to /httpdocs/foo/ will use /httpdocs/foo/.htaccess and, if that doesn’t exist, it will use /httpdocs/.htaccess. If your document root is pointing to /httpdocs/wordpress/, then users will see http://www.example.com as … Read more