• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem using SE Friendly URLs

Guest
Sep 03, 2007 Sep 03, 2007

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

691

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Sep 04, 2007 Sep 04, 2007
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

Votes

Translate

Translate
Engaged ,
Sep 03, 2007 Sep 03, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 03, 2007 Sep 03, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 03, 2007 Sep 03, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 04, 2007 Sep 04, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 04, 2007 Sep 04, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2007 Sep 04, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 04, 2007 Sep 04, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation