Author Topic: htaccess prevents virtual includes...  (Read 8656 times)

0 Members and 1 Guest are viewing this topic.

Offline 7exclusive

  • Newbie
  • *
  • Posts: 11
    • View Profile
htaccess prevents virtual includes...
« on: January 12, 2011, 04:08:54 AM »
Hey all,

I have this strange issue here that I cannot seem to solve.

So here goes:
I have 2 index faces for my page (index.html and index.shtml).
In TP I have put index.html as my main page, index.shtml as page#2
Lastly, I have created the htaccess file: DirectoryIndex tp_in.php index.shtml index.html index.php index.cgi

Problem now is that the 2 index faces are indeed showing at random, but all my virtual includes in my templates are not processed.
for example: <!--#include virtual="navigation.html" -->
this code is not processed and therefore the navigation bar at the top is not shown. (I also have a toplist.html, a thumblist.html etc).

When I remove the htaccess file form the server, I get all my virtual includes back (so the navigation bar is shown again), but then I only get the the main index.html page (index.shtml is then never shown).

I tried to add the navigation.html to the htaccess file so I would get:
DirectoryIndex tp_in.php index.shtml index.html index.php index.cgi navigation.html

but this doesn't seem to solve the issue (navigation bar is still not shown).

My website: www.7exclusive.com

Any help on this issue would be greatly appreciated  :)

ps. my archive pages still generate alls virtual includes without any problem... (http://www.7exclusive.com/st/archives/archive0.html)

Best Regards,
7exclusive
« Last Edit: January 12, 2011, 04:26:07 AM by 7exclusive »

Offline 7exclusive

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: htaccess prevents virtual includes...
« Reply #1 on: January 13, 2011, 01:49:26 AM »
Hmmmm... No one else has encountered this problem before?  ???

Offline ip0li

  • miSearkXD
  • Administrator
  • Hero Member
  • *****
  • Posts: 1952
    • View Profile
    • Premier Сasual Dating Real-life Girls
Re: htaccess prevents virtual includes...
« Reply #2 on: January 13, 2011, 05:59:38 AM »
You should discuss this with your host since it's htaccess and not TP related, I never had issue like this before :(

Offline 7exclusive

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: htaccess prevents virtual includes...
« Reply #3 on: January 15, 2011, 12:57:41 AM »
My host says it's has nothing to do with the hosting...  :(

Anyone else maybe knows if there's something I can add or change to htaccess file to have the virtual included files show up? As htaccess prevents them from showing (when I remove htaccess everything loads normally), I assume there is something I can add to the htaccess file to make them 'allowed' or something...

Or maybe an even easier solution is possible? I don't know...

Any help would be greatly appreciated!

Thanks in advance!

Best Regards,
7exclusive

Offline Kildoozer

  • Administrator
  • Sr. Member
  • *****
  • Posts: 420
    • View Profile
Re: htaccess prevents virtual includes...
« Reply #4 on: January 17, 2011, 11:40:17 AM »
Hi.
1. If you use tp_in.php + Include main pages (if possible) instead of header: (Location..) enabled, then your pages becomes php pages, and  <!--#include virtual=.... won't work.
So use tp_in.php + REDIRECT to main pages, turn off Include main pages (if possible) ..... option
2. If your original .htaccess file has directive for server to parse *.html files for ssi - copy these directives to new htaccess, with DirectoryIndex tp_in.php....

Offline 7exclusive

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: htaccess prevents virtual includes...
« Reply #5 on: January 19, 2011, 01:39:51 AM »
Hey Kildoozer,

Thanks! turning off that option indeed did the trick for me :)
Many thanks for providing the solution!

Best Regards,
7exclusive

Offline 7exclusive

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: htaccess prevents virtual includes...
« Reply #6 on: January 20, 2011, 01:12:21 AM »
Hey,

I do have this strange side effect when turning off the mentioned 'Include main pages (if possible) .....' option:

Now my productivity has fallen from 200% to around 100%, and my incoming hits have doubled (from 6k to 12k).

And when I used to refresh the page, I always got to see the 2nd face (index.shtml)... Now when I keep refreshing, I always get to see the index.html page so it seems, the pages are not really alternating?

According to google analytics I'm closer to 6k than 12k, so it seems incoming hits are counted double?

Also, when I got to www.7exclusive.com, the url gets transformed to http://www.7exclusive.com/index.html?tp_s=1


EDIT / SOLUTION:
Looks like when I turn the option back on and use for example <?php include("toplist.html"); ?> instead of <!--#include virtual="toplist.html" --> in my template html files, the php one does indeed get rendered as it should be... Guess I'm just going to replace all my includes with php includes and see what happens.

The problem with the double counting is that I had the htaccess tracking enabled + also had the <!--#include virtual="/tp/ssi_in.php"--> present (which by disabling the 'Include main pages (if possible) .....' option got activated (the include code got rendered and most likely caused the double tracking).

Maybe this is useful for anyone who encounters the same problem...



Best Regards,
7exclusive
« Last Edit: January 20, 2011, 02:38:45 AM by 7exclusive »