Posts Tagged ‘Windows’

How-To Redirect PATHINFO (Almost Pretty) Permalinks To Pretty Permalinks

Wednesday, March 21st, 2012

This post is about supporting your former PATHINFO Permalinks structure (a.k.a. Almost-Pretty-Permalinks), on your new web-site using Pretty-Permalinks.

 Redirect 301 /index.php/ http://www.yoursite.com/
 RewriteRule . /index.php [L]

These are the lines of Apache’s configuration that must be present in the website’s main .htaccess file:

 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 Redirect 301 /index.php/ http://www.yoursite.com/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>

This case applies to those websites formerly configured to use PATHINFO Permalinks and for which all the old posts and pages have been indexed by the Web Search Engines (Google, Yahoo, Bing, etc) using the former structure that included the HORRIBLE! “/index.php” string in their URIs, i.e.:

https://www.marcomc.com/index.php/tech/

When these sites finally migrate to the Pretty-Permaling structure, the one that does NOT include the  horrifying “/index.php” piece, i.e.:

https://www.marcomc.com/tech/

it happens that all the search engines’ indexes will result suddently outdated, and that will penalise the sites at least in two ways:

  1. It will cause a loss of accesses because the back-links to the sites that are present on other blogs or in people’s favourites and bookmarks, or in the search engines’ indexes will be ‘broken’ (old) and the people will be unable to access the pages or posts unless browsing from the homepage.
  2. It will cause a loss of ranking in the search engines’ databases (S.E.O. perspective) because the sites will result ‘broken (unaccessible) and in some cases may even result like sites with duplicated content because the search engines’ spiders will index the pages as NEW pages (due to their new URIs) and the content will match the caches indexed with the old URIs (at least until the caches expire).

To prevent such mayhem you need to put in place a 301 (permanent) redirection that will tell the search engines that all the requests to URIs containing the ‘/index.php’ bit have to redirected to similar URIs not containing it, i.e.:

Redirect 301 /index.php/ https://www.marcomc.com/

This string gives instructions to the web server about what to communicate to the Search Engines when a PATHINFO request is received.

Most importantly the 301 redirection will instruct the search engines that the URIs containing “/index.php” have to be considered deprecated and that from now on, the site will not use it anymore. This is fundamental to avoid the search engines to consider the content of the site as a duplicated content.

Secondly you will need to put in place also a generic rewrite instruction that will tell the local web server (Apache) to accept all the incoming requests to URIs with a PATHINFO format and return the content of the new and purged URIs:

RewriteRule . /index.php [L]

This string gives instructions to the web server on what it must to do when a PATHINFO request is received.

I did use these redirection settings for my WordPress blog when I did migrate to a full L.A.M.P. server (GNU/Linux, Apache, MySQL, PHP) from the former Windows Server hosting service running Microsoft IIS and that did not support ‘.htaccess’ files but exclusively PATHINFO directives and for which I did not have access to the server’s core configurations, therefore I was forced to use “/index.php” in my permalinks.

If you did like this post leave a comment in sign of appreciation, ad if you are Facebook please consider to ‘Like’ MarcoMC.com page. Check the FB banner on the right widgets column of this page …     ========================================>>

I did take inspiration for this post at following this thread:

http://www.wptavern.com/forum/troubleshooting/489-mod_rewrite-make-pretty-permalinks-prettier.html

How-To Set Up a Continuos Synchronization on The Background With Windows 7 and The Group Policy Editor

Saturday, September 3rd, 2011

Using the Offline Files in Windows Vista or Windows 7 is not always a smooth process and can cause a lot of Offline Folders And Files Synchronization Errors.

Offline Files synchronization errors

Offline Files synchronization errors

I found the latest generation of Windows to be very sensitive in the process to keep synchronized the Offline Files and folders copy with the  remote share.

Depending on the quality of the network you rely or the quality of the link to the share the Windows 7 (or VISTA) clients may think that the share is temporarily unavailable and stop synchronizing the Offline Folder while leaving temporary files on the server.
That may confuse some applications, especially Microsoft Office making them believing that a file you just edited and closed is still opened by another application and will refuse to open such file again.

I.E.. I have a very unadvisable configuration where a Linux server is providing an NFS share to a Mac OS X Snow Leopard server, and that server is then re-sharing via SMB and AFP that share to Windows and Mac OS X clients. I have experienced problem with Windows Clients stopping to synchronize files without any reasonable motivation.

I understood that because of an obvious delay on the communication from the Windows client through the Mac OS X server (via SMB)  to the Linux server (via NFS) would make the Windows client believe that the share was offline with many unconfortable conseguences.

I have found a workaround to this problem playing a little with the Windows’s Group Policy Editor.

As I don’t have a Windows Domain in place I couldn’t generate a policy file to be pushed once for all to all the clients so I had to manually start and configure the Group Policy Editor on each single Window VISTA and Windows 7 machine.

This is how to set up a continuos synchronization on the background with the Local Group Policy Editor:

  1. Start the Local Group Policy Editor

    Launch The Local Group Policy Editor

    Launch The Local Group Policy Editor

  2. Expand the Computer Configuration policies to ‘Network -> Offline Files’
    Group Policy Editor

    Group Policy Editor

    Slow Link Speed

    Slow Link Speed

  3. Access the ‘Configure Backgraund Sync’ option to enable the background sync

    Configure Background Sync

    Configure Background Sync

  4. Activate the ‘Enable Transparent Caching’ option

    Enable Transparent Caching

    Enable Transparent Caching

  5. Access the ‘Configure slow-link mode’ option to enable the support for slow-link networks

    Slow Link Mode

    Slow Link Mode

  6. Access the ‘Configure slow-link speed’ to configure the latency level to detect weather the connection get slow.
    Follow the suggestions shown in the LGPE to calculate the appropriate value.

    Configure Slow Link Speed

    Configure Slow Link Speed

These settings should avoid many of your problems and so far they did not create any additional issue.

Please comment and post your experience about any problems with the use of Offline Files and Folders.

How-To fix pGina: “Warning: Current plugin selected could not be loaded!”

Thursday, September 1st, 2011

After installing pGina and the chosen plugins (i.e. LDAP Auth, LDAP Group, RADIUS) on Windows Vista or Windows 7, it may happen that trying to access the plugin configuration it results in an error loading the plugin with the following error message being returned:

"Warning: Current plugin selected could nor be loaded!
You may not be able to login using pGina!"
Warning: current plugin selected could not be loaded

Warning: current plugin selected could not be loaded

The most common reasons for such error are:

 

  1. The installed plugin is for a different architecture:According to your system you must choose to install the x86 (32 bits) or
    x64 (64 bits) version of the plugin.
    Some plugin may be released on a single version but this doesn’t imply that it will work for both the architectures.
  2. Otherwise it most probably happens the you are missing the installation of the Visual C++ 9.0 (2008) runtime libraries (VC90.CRT 2008):In this case you need simply to download the Microsoft Installer package from Microsoft’s site at

    x86: http://www.microsoft.com/download/en/details.aspx?id=5582
    x64: http://www.microsoft.com/download/en/details.aspx?id=2092

Applying one of these two fixes you should have resolved your problems otherwise you may consider to check the file permissions on the plugin files.

 

WordPress 3.1 update: “Could Not Open the Page, Too Many Redirects”

Thursday, February 24th, 2011

This morning after upgrading my blog to WordPress 3.1 the front side of my blog suddently stopped working.
All my browsers got stuck trying to load www.marcomc.com and Mobile Safari on my iPad and my iPhone was complaining about: “Could Not Open the Page, Too Many Redirects”.

After 1 minute digging the problem on wordpress.org I found the fix at this thread:

http://wordpress.org/support/topic/windows-server-infinite-redirect-after-upgrading-to-31?replies=35

I was still able to access the admin back-end fortunately, just in time to apply this nice plug-in that fix the problem:

Permalink Fix & Disable Canonical Redirects Pack

Apparently this problem is limited to WordPress residing on Windows based hosting. Guess what my hosting is then 😉

How-To user EtherApe graphical network monitor with Windows, Mac OS X or Linux

Monday, February 14th, 2011

EtherApe is a graphical network monitor for Unix that come with most of the GNU/Linux distrubution but is not, now is present in MacPorts for Mac OS X and but has no porting for Windows as well.

The best use of EtherApe is when it’s installed on a server (or any GNU/Linux machine) connected to the last-hop of your network to allow it to ‘sniff’ (analyze) the whole traffic getting in-and-out of your network. I suggest to put it on the  switch or hub that connects your network to the router.

Normally we monitor and manage our network from our workstation trying to access as less as possible the screen of our servers. Because EtherApe would be installed on one of our servers to visualize its output on our screen avoiding the user of screen remotization like VNC, TeamViewer or LogMeIn we need to use X11 protocol forwarding via SSH.

This solution implies that we have and X11 service running on our workstation.
If we are working on a Linux machine it can’t be more easy as we mostprobably are working on a X11 implementation.
If run Mac OS X then we ned to installe Apple’s X11, and you can find the installer inside the Installation disc.

For Windows the game is more tough because it’s not a Unix based system and a X11 server implementation is not part of the standard applications offered as part of the installation options.
Fortunately come in hand the project Xming a free implementation of X Server for Windows: http://www.straightrunning.com/XmingNotes/

The steps to visualize EtherApe on your workstation are:

  1. Install EtherApe on your GNU/Linux server:
    i.e. on a GNU/Debian server: 

    # apt-get install etherape
  2. Install X11 on your workstation:
    1. On Linux most probably you have installed x.org package
    2. On Mac OS X you install the package that you find in the installation disc
    3. for windows you need to donlaod the public release of Xming:
      http://sourceforge.net/project/downloading.php?group_id=156984&filename=Xming-6-9-0-31-setup.exe
  3. Install an SSH client on your workstation
    1. On Linux and Mac OS X it is part of the base system installtion
    2. On Windows you need to install PuTTY:
      http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
  4. Enable X11 forwarding through SSH on your server:
  5. Edit the file /etc/ssh/sshd_config and add or modify the X11 forwarding setting to
    X11Forwarding yes

    then restart the SSH service to load the new configuration

  6. On Windows only configure Xming to connect via the SSH client to your Linux server and specify to run the program xterm (or any other terminal application you have installed on your server) and specify as connecting user root or any sudoer user because EtherApe needs root privileges to turn the network card in listening mode.
  7. run EtherApe from the ssh connection just fireing the command ‘etherape’

Have fun!