CMS/htaccess

I’m using a CMS (MySQL, not flat-file) and an htaccess file to remove
the file extension and add a trailing slash. So far so good

The problem is some pages render as expected, ie, no extension with
trailing slash, while others don’t.

For example, if typing a url without a file extension (somesite.com/
test) the page is missing only certain dynamic content (specifically
video) while other dynamic content (text/images) render fine within
the same page. If I type the same url with the “.php” extension, all
is good. I could understand if the dynamic content was either all
there or all missing, but it’s not. Ideas?

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Are you using a base href directive in your pages? Is there any difference between trailing slash and no trailing slash?

Walter


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Are you using a base href directive in your pages? Is there any
difference between trailing slash and no trailing slash?

If you’re referring to manually typing the url then no, there’s no
difference if the trailing slash is included or not, some content is
missing either way.

I’m including <?php include('mycms/runtime.php'); ?> at the top of the
page, if that’s what you mean.

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No, for any URI that isn’t completely well-formed, the browser works
out the rest of the path for any relative adresses from what’s known
as the base href. In a normal HTML page (one that hasn’t been tampered
with using rewrite, in other words) this is precisely the same as
removing the current page filename from the total URL. So if you were
at:

http://www.example.com/foo/bar/baz.html

the base href would be

http://www.example.com/foo/bar/

Now in a case where you have tampered with the URI, any relative
addresses would need to know the real starting point to add on to,
because the URI sent by the server to the browser is a complete
fiction. In your case, I’m guessing that the browser is thinking that
your tail-less filename is really a directory name, and isn’t coming
up with the right location for your other files. In effect, it’s
looking for them one directory level below where they really are.

There’s two ways to fix that. One is to make sure that any and all
resource URIs are made root relative, so instead of Resources/
image.jpeg, you would write /foo/bar/Resources/image.jpeg. The other
is to add a base href tag to the page, up in the head before any
relative links are processed:

<base href="http://example.com/foo/bar/" />

Then any relative URIs will be calculated with that as a starting point.

Walter

On Feb 28, 2011, at 4:47 PM, Todd wrote:

Are you using a base href directive in your pages? Is there any
difference between trailing slash and no trailing slash?

If you’re referring to manually typing the url then no, there’s no
difference if the trailing slash is included or not, some content is
missing either way.

I’m including <?php include('mycms/runtime.php'); ?> at the top of
the page, if that’s what you mean.

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What’s curious is if the base href were incorrect then why wouldn’t
all the dynamic content be missing? It seems to only affect video
content. I can’t see any reason why the videos can’t be found yet
everything else is fine.

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Look carefully at the HTML as rendered in view source. Compare the
src= of the video and any other resource that works, like an image.
Does one start with a forward slash while the other does not? That
would confirm my suspicion about the base href.

Walter

On Feb 28, 2011, at 5:17 PM, Todd wrote:

What’s curious is if the base href were incorrect then why wouldn’t
all the dynamic content be missing? It seems to only affect video
content. I can’t see any reason why the videos can’t be found yet
everything else is fine.

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Look carefully at the HTML as rendered in view source. Compare the
src= of the video and any other resource that works, like an image.
Does one start with a forward slash while the other does not? That
would confirm my suspicion about the base href.

They all start with a “/”, images and video. And there is no src for
the videos.

Example:

<script language="javascript" type="text/javascript">
   QT_WriteOBJECT_XHTML('/mycms/resources/somemovie.mov', '320',  
'256', '', 'autoplay', 'true', 'bgcolor', 'black', 'align', 'middle',  
'showlogo', 'false');
</script>

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Cap-R for Resources, if you’re using Freeway to generate any part of
this. If you’re not, and your resources folder is downcase like that,
then I don’t know. What about the path to your JavaScript library from
whence comes the QT_WriteOBJECT_XHTML function? That’s another reason
why you might not be getting the right path. Or, there may be
something inside that library which is using the base URL and other
things are not.

If you’re looking at this site in Safari, remember you can open the
Web Inspector, double-click any line of code, or any attribute in the
CSS, and type over it to change the source in the DOM. You’ll see the
result without any reload, so you could tinker with the whole site in
the browser until it works, then reverse-engineer the necessary
changes to put into your HTML or PHP.

Walter

On Feb 28, 2011, at 6:05 PM, Todd wrote:

Look carefully at the HTML as rendered in view source. Compare the
src= of the video and any other resource that works, like an image.
Does one start with a forward slash while the other does not? That
would confirm my suspicion about the base href.

They all start with a “/”, images and video. And there is no src for
the videos.

Example:

<script language="javascript" type="text/javascript">
 QT_WriteOBJECT_XHTML('/mycms/resources/somemovie.mov', '320',  
'256', '', 'autoplay', 'true', 'bgcolor', 'black', 'align',  
'middle', 'showlogo', 'false');
</script>

Todd


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options