Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > Content Mangement Systems – CMS > WordPress - The Ultimate Blog

Notices

WordPress - The Ultimate Blog WordPress is a personal blog publishing tool with focus on aesthetics and featuring cross-blog tool, password protected posts, importing, typographical niceties, multiple authors, bookmarklets. This is a very cooool tool!

Reply
 
LinkBack Thread Tools
  #1  
Old 05-11-2007, 09:42 PM
Private
 
Join Date: May 2007
Posts: 1
Default Fixing Pretty Permalinks with Mod_Rewrite in Wordpress Blogs

I have a client who has chosen Vodahost for her blog. She uploaded the theme for her wordpress blog and I'm customizing it and Optimizing it for search engines.

The pretty permalinks (Options | Permalinks ) for "Custom Permalinks structure" was not working.

Default worked, but if I wanted to customize the permalinks for a true representation of the post using the custom permalink structure, it would just fail and come up 404 not found.

I could get it to work if I tried other things, but it would include the index.php into the url ie: www.domain.com/index.php/uncategorized/post.html

having the index.php in the url was a bit messed up though and was not as efficient for the search engines as it could be.

I contacted support and they told me that mod_rewrite was in fact turned on for the vodahost website.

I finally found this solution:

The following piece of information from the Using Permalinks codex helped fix the problem:

Quote:
Server Blockage: Your host might have blocked the SERVER_SOFTWARE variable and this will cause WordPress' .htaccess generation to fail. If you are sure that your server is running Apache, you can force WordPress to believe that your server is running Apache by changing your wp-includes/vars.php file. Follow the steps below to implement these changes.

1. Open the wp-includes/vars.php file using the built in file editor in your WordPress Admin panel. To navigate to this panel, login to WordPress, click on "Manage", then on "Files", scroll to the bottom and type in wp-includes/vars.php into the text box under the "Other Files" title.
2. Look for $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;, once you find it replace it with // $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
3. Add a new line under // $is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0; and type in $is_apache = 1;

I modified the vars.php file as described above to force WP to believe that Apache was there. Then I reset my permalink options to the default style and deleted the .htaccess that was there.

I then went back to Permalink options and created the Pretty Permalink style. WP successfully created the new .htaccess with the proper mod_rewrite rules.
I found the solution above and used it with one modification.

when I tried to update the vars.php file using the built in editor, it failed to save, so I had to download the vars file to my computer, update it with the line specified in the post above, and then upload the vars.php file again.

changed the permalinks back to default

deleted the .htaccess file

changed the permalinks back to my custom /%category%/%postname%.html and it created the new .htaccess file with the rewrite code updated.

nice.

I'm posting this here because it solved the problem I've been looking for for a good 4 or more hours. In fact, I gave up but then the vodahost server crashed - motherboard fried and we lost everything we had done.

This time, I didn't want to do any modifications or spend too much time on the blog until I had this resolved. This time, I found the answer and used the method above with success.

I hope this helps with anyone else looking for the answer to pretty permalinks using mod_rewrite with Wordpress and vodahost

there- that last sentance should index this post with those key phrases for anyone else looking for this solution.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 03-28-2008, 01:04 PM
Private
 
Join Date: Oct 2007
Posts: 2
Default Re: Fixing Pretty Permalinks with Mod_Rewrite in Wordpress Blogs

Thank you so much for posting this. I thought I was going mad because I couldn't see my Pages after changing the Permalink.

In Wordpress 2.3.3 the line to comment out with // looks slightly different, but don't worry about it, just add the line shown

$is_apache = 1;

underneath it (after you've put // at the front of the offending line) and it works a treat.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 05-20-2008, 11:08 AM
Private
 
Join Date: Oct 2007
Posts: 2
Default Re: Fixing Pretty Permalinks with Mod_Rewrite in Wordpress Blogs

In Wordpress 2.5.x the offending line is

$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false;

Put // in front of this line and then add

$is_apache = 1;

underneath so the entry should look like this:

//$is_apache = ((strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) || (strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false)) ? true : false;

$is_apache = 1;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 11:24 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2007 VodaHost.com - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54