7 Replies Latest reply on Sep 4, 2007 1:01 PM by jasonpresley

    Problem using SE Friendly URLs

    jasonpresley Level 1
      Anyone had issues using search engine friendly urls and css? I have a page that looks just fine when I go to the page with the following url: http://localhost/demo/index.cfm. However If I change the url to http://localhost/demo/index.cfm/about-our-company the page acts as if the css style sheet is not found. I am totally clueless as to what could be causing this. Anyone have any idea? I would really appreciate it!

      Thanks,

      Jason
        • 1. Re: Problem using SE Friendly URLs
          Stressed_Simon Level 1
          I bet you are using a relative path for your css include instead of a root path. So if you have the following in your http://localhost/demo/index.cfm
          <link href="../styles/main.css" rel="stylesheet" type="text/css" />

          then it will look in the next folder up for a folder called styles with a file called main.css

          If you have the same line of code in http://localhost/demo/index.cfm/about-our-company then it will look for a folder in the root called demo with a folder in called index.cfm with a folder in called styles with a file in called main.css.

          To solve this you need to reference your style sheet as follows:-
          <link href="/styles/main.css" rel="stylesheet" type="text/css" />

          Notice how the href begins with a forward slash (/) this means to always access it from the webroot. You will need to do this for all your internal links as well because they will not work, this means links and image references the works.

          HTH
          • 2. Re: Problem using SE Friendly URLs
            jasonpresley Level 1
            Actually I have tried several different paths including:

            /styles/main.css
            http://localhost/demo/styles/main.css

            I have even embed the css directly onto the page. The index file looks fine when the /about-our-company is not included but as soon as I add the suffix to the end the css won't render.

            Here is my code with styles embedded in the head:

            index.cfm

            • 3. Re: Problem using SE Friendly URLs
              BKBK Adobe Community Professional & MVP
              just fine when I go to the page with the following url: http://localhost/demo/index.cfm. However If I change the url to http://localhost/demo/index.cfm/about-our-company the page acts as if the css style sheet is not found.

              http://localhost/demo/index.cfm/about-our-company is simply a bad URL. Your intention is to style the page index.cfm. However, as Simon has suggested, your URL actually implies that the page you wish to style is about-our-company, situated in a folder called index.cfm. It is not even a CFML page.

              • 4. Re: Problem using SE Friendly URLs
                jasonpresley Level 1
                It is not the traditional format for a url but it is not a "bad" url. I am using MangoBlog from ASFusion.com on my site and if you look at any of the blog postings the url looks just the same and the page displays just fine with the css rendering properly. Ray Camden uses these kinds of URLs in his blog application and Ben Forta wrote an article on using these kinds of urls because they were more search engine friendly. So this is not a "it can't be done" thing because it is being done I just am running into a strange issue using it. If anyone knows how to use these kinds of url successfully please let me know.

                Jason
                • 5. Re: Problem using SE Friendly URLs
                  jasonpresley Level 1
                  Must have been some kind of cache bug issue or something. I have set all css links and all image links to absolute links ( http://localhost/demo/styles/style.css). After coming back to it began to work. don't understand but the url can have a /search-engine-friendly-parameter following it and the page will display correctly.

                  Thanks to Stressed_Simon and Ray Camden for pointing me in the right direction!

                  Jason
                  • 6. Re: Problem using SE Friendly URLs
                    BKBK Adobe Community Professional & MVP
                    It is not the traditional format for a url but it is not a "bad" url. I am using MangoBlog from ASFusion.com on my site and if you look at any of the blog postings the url looks just the same and the page displays just fine with the css rendering properly. Ray Camden uses these kinds of URLs in his blog application and Ben Forta wrote an article on using these kinds of urls because they were more search engine friendly. So this is not a "it can't be done" thing because it is being done

                    "Bad" doesn't imply "it can't be done". I am aware of websites that use such URLs. Some might be search-engine friendly, but they fail to be intuitive or user-friendly. In any case, don't let me spoil it for you. The main thing is that your pages are now running as you want them to.

                    • 7. Re: Problem using SE Friendly URLs
                      jasonpresley Level 1
                      Sorry, I misunderstood. I took "bad" to mean exactly that - non functional. I will agree with you to a point on non-user friendly. They are not as nice as www.mysite.com/aboutme.htm. However they are better than www.mysite.com/page.cfm?contentID=5&display=true.

                      Thanks for your help and input.