what could cause the htaccess file to be modified?

This might happen when the rewrite rules are flushed. The function insert_with_markers() is using fopen(), but not flock(), so when two pieces of code are calling flush_rewrite_rules() almost at the same time, the second process can write to that file before the first one has closed it. Check your plugins and your theme for flush_rewrite_rules(), … Read more

Temp URL Redirect Loop

I assume IP stands for your IP address. In that case you are probably blocked by hostgator, as it can’t decide based only on the IP address which account is being accessed. in addition ~username is probably a URL that isn’t configured/accessible on the server. In other words, ask hostgator for support. Why do you … Read more

WordPress site not working after move

You need to login to the database and manually edit 2 entries. In the wp_options table you can find siteurl and home. Update those appropriately, you should then be able to login properly. You also need to update your .htaccess file but if you edit your permalink options and then change them back this should … Read more

Apache Fallback instead of add_rewrite_rule

This fixed my issue. function my_query_vars($vars) { $my_vars = array( ‘PARAMETERS’ ); return array_merge($my_vars, $vars); } add_filter(‘query_vars’, ‘my_query_vars’); function my_rewrite_rules($rules) { global $wp_rewrite; $my_page=”PAGESLUG”; $my_rule = array( ‘URL/?’ => ‘index.php?pagename=” . $my_page . “&school_type=$matches[1]’ ); return array_merge($my_rule, $rules); } add_filter(‘page_rewrite_rules’, ‘my_rewrite_rules’);

Modify the .htaccess file

You could try changing the permissions on the .htaccess file itself. 755 7 – owner – read/write/execute 5 – group – read/execute 5 – everyone else – read/execute Neither WP or a plugin can edit/overwrite it; but then you would need to manually change it from there on out. Maybe that will help you narrow … Read more

Permalinks not working with Vagrant

I solved the problem myself. In the default apache configuration, under /etc/apache2/sites-enabled, where mine is called 15-default.conf This was declared under the document root: <Directory “/var/www”> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> I had to change AllowOverride None to AllowOverride All. Thus you’ll get the following: <Directory “/var/www”> Options … Read more

How to change home or site url using action hooks or filter?

Ok. Then you can use template_redirect hook and wp_is_mobile() conditional tag. wp_is_mobile() will work on device only. If you resize the window then it will not work. Now you can try this kind of code in your functions.php file add_action(‘template_redirect’, ‘redirecting_to_mobile_site’); function redirecting_to_mobile_site(){ if( wp_is_mobile() ){ wp_redirect( ‘http://m.example.com’, 301 ); exit; } }

htaccess has broken my site

Enable debugging in wp-config.php and check for errors. define( ‘WP_DEBUG’, true ); If you see blank white screen then it means.. Either you renamed your theme folder name. Some plugin is blocking access. Enable debigging and post errors here. EDIT You will have to try uploading files manually. Download no content WordPress from here. https://downloads.wordpress.org/release/wordpress-4.0-no-content.zip … Read more