Site images broke when using internal pretty urls

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
crozi

Site images broke when using internal pretty urls

Post by crozi »

Running CMSMS .13 Canary
PHP version  4.3.11
MySQL version 4.0.25-standard

Images upload fine and display correctly in the image manager and on the root page (i.e. http://www.example.com/), but break as soon as you click a menu link and are sent to a new page (i.e. http://www.example.com/index.php/about).

After looking at the generated code it appears that the image source path is "uploads/images/image.jpg" so the server thinks the image is located in "index.php/about/uploads/images/image.jpg" which doesn't exist. I have been able to fix the problem by hard-coding the full url into the image source, but would like to not have to do that. Anyone know how I can fix this?
Last edited by crozi on Tue May 23, 2006 4:46 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Site images broke when using internal pretty urls

Post by Ted »

Toss a {metadata} tag in your template(s) in the section.  That'll add a base tag that will fix the problem.
crozi

Re: Site images broke when using internal pretty urls

Post by crozi »

Wow, thanks for the quick working solution! I thought I had put the {metadata} tag in my templates, but when I went back I had a tag in there instead, oops!
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

Re: Site images broke when using internal pretty urls

Post by scotch33 »

Hi - I was experiencing the same problem.  Adding the {metadata} has only worked on one of my 3 templates - all the others are still not playing ball.

Also - I actually want to code the metadata to be in the template, nit the individual pages - so is there anyway to get around this other than ditching this latest version and goign back to one that I know can do the job?

Ta!  Scotch
mahjong

Re: Site images broke when using internal pretty urls

Post by mahjong »

scotch33 wrote:Also - I actually want to code the metadata to be in the template, nOt the individual pages
In the Admin console, Site Admin->Global Settings->Global Metadata
trident

Re: Site images broke when using internal pretty urls

Post by trident »

I installed cmsms 0.13 and do not get the inside pages. the {metadata} tags are already there in all the templates. I am using IIS on Windows XP and my PHP is 4.4.

For example -

http://localhost/lions/index.php/content_types

gives the error - page cannot be found!

if i type the following  (without .php) into the browser -

http://localhost/lions/index.php?page=content_types

it works

what could be wrong here?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Site images broke when using internal pretty urls

Post by Dr.CSS »

if you upgraded the pretty url stuff is turned off by default you will need to edit the config.php file yourself...
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Site images broke when using internal pretty urls

Post by Elijah Lofgren »

trident wrote: I installed cmsms 0.13 and do not get the inside pages. the {metadata} tags are already there in all the templates. I am using IIS on Windows XP and my PHP is 4.4.

For example -

http://localhost/lions/index.php/content_types

gives the error - page cannot be found!

if i type the following  (without .php) into the browser -

http://localhost/lions/index.php?page=content_types

it works

what could be wrong here?
The pretty URL scheme that was on by default doesn't work with IIS. This will be turned off by default in the next version of CMSMS.
Instructions for fix here:
http://forum.cmsmadesimple.org/index.ph ... l#msg30261
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Site images broke when using internal pretty urls

Post by Elijah Lofgren »

chechogr wrote: Could you explain me a little better what pretty URLs consists of?

I am building URLs like this:

http://www.mydomain.com/cmsmadesimple/i ... ccessories

All my pages are being built based on the page alias, wich in this case is Apparel-and-accessories

Can I build better URLs?

Thanks

Andy
A pretty URL would look like:
http://www.example.com/cmsmadesimple/Ap ... cessories/

You can find out how to turn them on here:  http://wiki.cmsmadesimple.org/index.php ... retty_URLs

Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Site images broke when using internal pretty urls

Post by Elijah Lofgren »

chechogr wrote: Should I just replace all the conent in the htaccess.txt file with this?:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ FOLDER/index.php?page=$1 [QSA]

and upload it into the root of my site or in the root of the folder where I installed CMSMS ?
I think you can use the above code and place it in the root of your site but make sure to change "FOLDER" to the name of your folder. Also you need to put it in a file named ".htaccess" (without a file prefix) not "htaccess.txt"

Or instead you could copy the first set of code on this page:
http://wiki.cmsmadesimple.org/index.php ... retty_URLs
and put in in a .htaccess file in the folder where you install CMSMS

chechogr wrote: where should this go?:

url.rewrite-final = (
  "^/(admin)/(.*)$" => "/$1/$2",
  "^/([^.?]*)$" => "/index.php?page=$1"
)
You shouldn't need that unless your server is running lighthttpd instead of Apache (you are very likely to be using Apache instead).


Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Site images broke when using internal pretty urls

Post by Elijah Lofgren »

chechogr wrote: I made a .htaccess file without the .txt and uploaded it into my site root with this content:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ cmcmadesimple/index.php?page=$1 [QSA]


I also made this changes in the config.php file:

#------------
#URL Settings
#------------

$config['assume_mod_rewrite'] = true;

$config['page_extension'] = '/';

$config['use_hierarchy'] = true;


then I inserted the {metadata} in all my templates between the {metadata}
and I am getting a 500 internal server error
What could be wrong?

In your .htaccess file try changing:
cmcmadesimple
to:
cmsmadesimple

Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Sean

Re: Site images broke when using internal pretty urls

Post by Sean »

I have the opposite problem, images are showing on the front end but not in the back end.
User avatar
tonypb
Forum Members
Forum Members
Posts: 104
Joined: Tue Nov 20, 2007 12:16 am

Re: Site images broke when using internal pretty urls

Post by tonypb »

i had the same problems and a co-worker asked somebody here and they got a fix

in the global settings "Metadata" just add:

this fixed the problem and all images appeared again
Last edited by Jo Morg on Mon Nov 17, 2014 12:55 pm, edited 1 time in total.
Reason: removed hidden html
patino-burch design
Anthony Patino-Burch
andrewvideo
Forum Members
Forum Members
Posts: 127
Joined: Fri Nov 28, 2008 10:28 pm

Re: Site images broke when using internal pretty urls

Post by andrewvideo »

Thank you Tonypb.  That's so amazing, it works, so simple. All my Photos and flash are back. Thanks again.
User avatar
Lucaz
Forum Members
Forum Members
Posts: 66
Joined: Fri Dec 01, 2006 9:56 pm

Re: Site images broke when using internal pretty urls

Post by Lucaz »

Ted wrote: Toss a {metadata} tag in your template(s) in the section.  That'll add a base tag that will fix the problem.
Nice thank you.

I use the section image tag/plugin:
{sectionimage lowercase=1 get_dimensions=1 levels=3 byname=1 image_path=img/producten extension="jpg"}
and had the same problem.

Using {metadata} solved the problem for me.
Locked

Return to “CMSMS Core”