2 Replies - 2090 Views - Last Post: 10 March 2016 - 11:41 AM

#1 trickstar34   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 109
  • Joined: 05-June 09

Strange Behavior in Virtual Hosting [Wordpress]

Posted 08 September 2015 - 01:08 PM

I have just installed WordPress into my web site and successfully integrated in into my designs layout using a custom theme and everything is working 100% for the most part but I do have a minor bug I want rubbed out seeing as I design web sites for a living and I don't want to be known for making buggy sites.

I use GoDaddy Windows hosting because I primarily use ASP.Net for my server-side scripting and for all web sites I made for myself I have all on the same hosting account to save money on unlimited bulk hosting and bandwidth. So pretty much I have multiple websites working by linking the domain name to the sub directories to my hosting account similar to as follows:

[root] - main web site
[root]/example - example.com
[root]/example2 - example2.com

On all the sites made from applications I designed myself it has no problem hiding that I am linking all the sites to the same hosting accounts. For example, I can display whats located at [root]/example/blog/index.html by typing "example.com/blog". However with WordPress it will redirect to "example.com/example/blog" even though I changed the settings to use "example.com/blog" as the sites address for all permalinks and the site home page as directed in the documentation. It will also cause a "Page Not Found" error (the one used by WordPress software that still displays my themes and shows no PHP errors). The strange thing is when I type "example.com/blog/" with the "/" at the end it shows up exactly as it's supposed to and functions 100%. I want to fix this bug so people that want to just type in "example.com/blog" it will show up correctly. I know this may not necessarily be a problem with the WordPress software but I figured I'd ask on here because I think what I'm trying to do is a very common practice and there are users on here who have experienced and fixed this problem specifically when dealing with Wordpress in the past that could help me out, seeing as I can't think of anything that would be causing this. Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Strange Behavior in Virtual Hosting [Wordpress]

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5510
  • View blog
  • Posts: 14,499
  • Joined: 18-April 07

Re: Strange Behavior in Virtual Hosting [Wordpress]

Posted 08 September 2015 - 03:15 PM

There are three places I often look when it comes to URL changes like this and usually 99% of the problems are in these three areas.

1) .htaccess file rewrites - In your web roots you should see an .htaccess file (it is often hidden because of the period starting the name of the file). In there Wordpress often writes its rules for how it handles URLs. You may also have other rules defined in there that are giving you the problems. So review that file.

2) Wordpress' permalinks section - Make sure that you have correctly defined the proper permalink structure. You can try changing it back to the default structure and test your site to see if things are working ok and then again go back to your current format and see if things change. These changes often rewrite things in the .htaccess file so check back with that file as you make changes to see if something is being altered that shouldn't be.

3) Plugins - there are a number of plugins that do URL rewriting, optimization (like friendly urls) or are simply hijacking one URL request and making it go to another. To eliminate this possibility, disable just about all your plugins and test your URLs again. If the problem disappears, then you have a plugin causing issues. So enable each plugin one at a time until you see the problem start. Then you know which plugin will be messing with you.

I hope this proves helpful. :)
Was This Post Helpful? 0
  • +
  • -

#3 PreciousReed   User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 142
  • Joined: 22-January 16

Re: Strange Behavior in Virtual Hosting [Wordpress]

Posted 10 March 2016 - 11:41 AM

Configure your .htaccess file.
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1