Page 1 of 2
Site images broke when using internal pretty urls
Posted: Tue May 23, 2006 4:42 pm
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?
Re: Site images broke when using internal pretty urls
Posted: Tue May 23, 2006 4:45 pm
by Ted
Toss a {metadata} tag in your template(s) in the section. That'll add a base tag that will fix the problem.
Re: Site images broke when using internal pretty urls
Posted: Tue May 23, 2006 4:52 pm
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!
Re: Site images broke when using internal pretty urls
Posted: Wed Jul 05, 2006 12:49 pm
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
Re: Site images broke when using internal pretty urls
Posted: Sat Jul 08, 2006 5:59 pm
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
Re: Site images broke when using internal pretty urls
Posted: Sat Jul 15, 2006 4:48 pm
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?
Re: Site images broke when using internal pretty urls
Posted: Sat Jul 15, 2006 5:17 pm
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...
Re: Site images broke when using internal pretty urls
Posted: Wed Jul 19, 2006 2:13 am
by Elijah Lofgren
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
Re: Site images broke when using internal pretty urls
Posted: Wed Dec 20, 2006 7:18 am
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
Re: Site images broke when using internal pretty urls
Posted: Wed Dec 20, 2006 2:58 pm
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
Re: Site images broke when using internal pretty urls
Posted: Wed Dec 20, 2006 7:28 pm
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
Re: Site images broke when using internal pretty urls
Posted: Mon Nov 12, 2007 5:47 pm
by Sean
I have the opposite problem, images are showing on the front end but not in the back end.
Re: Site images broke when using internal pretty urls
Posted: Thu Feb 28, 2008 3:50 am
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
Re: Site images broke when using internal pretty urls
Posted: Thu Jan 01, 2009 3:32 pm
by andrewvideo
Thank you Tonypb. That's so amazing, it works, so simple. All my Photos and flash are back. Thanks again.
Re: Site images broke when using internal pretty urls
Posted: Tue Mar 24, 2009 2:49 pm
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.