How to redirect folders (and all the link)

For example, if we want to redirct to We could use mod_rewrite. Put this in your .htaccess file Options +FollowSymLinks RewriteEngine On RewriteRule /php/(\w+).html /wordpress/$1.html [R=301,L]

Using .htaccess pointing domain to specific directory

If a server hosting 2 domains, we can use this .htaccess (on the root) to point the 2 different domains to 2 Directories on the same server: RewriteEngine On RewriteBase / # pointing for the domain to folder1 ReWriteCond %{HTTP_HOST} ReWriteCond %{REQUEST_URI} !folder1/ ReWriteRule ^(.*)$ folder1/$1 [L] # pointing for the domain […]

WordPress Permalinks Does Not Work in xampp Setup

xampp provides a convenient way to quickly and easily install and setup a web server that works without much configuration. However, permalinks feature won’t work with the default installation of xampp, even though you can properly customize the permalinks structure to create the .htaccess file.

.htaccess redirect ALL traffic to another domain

.htaccess code: redirect 302 / you can also redirect access via PHP, using the header() function: // Permanent redirect: header(‘HTTP/1.1 301 Moved Permanently’, true); header(‘Location:’); // Temporary redirect (note that sending the ‘Location’ header automatically sends a 302 redirect unless it is explicitly overwritten, as it is above): header(‘Location:’);

No Sidebars Defined

This should work. In sidebar.php, add this just after the first < ul > : Add this just before the last < /ul > : Now create a new, blank page in your editor and save it as functions.php . Place this on the new functions.php page: Upload functions.php and sidebar.php to the theme folder. […]

list all posts

<h3>Posts</h3> <ul>                 <?php while(have_posts()) : the_post(); ?> <?php foreach((get_the_category()) as $category)                           { $my_query = new WP_Query(‘category_name=’ . $category->category_nicename . ‘&orderby=title&order=asc&showposts=100’);} ?>                        <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>        <li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></li>                       <?php endwhile; ?> <?php break; endwhile; ?> </ul>

Code to display visitors IP address on website

get_ip_list below is a function that you must call in order to get something. function get_ip_list() { $tmp = array(); if (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’]) && strpos($_SERVER[‘HTTP_X_FORWARDED_FOR’],’,’)) { $tmp += explode(‘,’,$_SERVER[‘HTTP_X_FORWARDED_FOR’]); } elseif (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $tmp[] = $_SERVER[‘HTTP_X_FORWARDED_FOR’]; } $tmp[] = $_SERVER[‘REMOTE_ADDR’]; return $tmp; } echo echo implode(“,”,get_ip_list());

Redirect by PC or mobile access

php code as follows: $iswap = isset($_SERVER[‘HTTP_ACCEPT’])? $_SERVER[‘HTTP_ACCEPT’]:”; if(strpos($iswap,”wap”)>0) { @header(“Location: /wap/”); }