I'm using windows 7 (64 bit).
If I place a site (index.php, other docs and other sub folders [css, js, imgs etc]
directly inside the htdocs folder (amongst the XAMPP folders)
and view the site through localhost there is no problem.
If instead the site is placed in a subfolder of htdocs, C:xampp/htdocs/mysite,
and I try to view index.php all links (relative) to subfolders (eg images, css and js etc) stop working.
I obviously would prefer to use xampp for more than one site, so i want to have a sub folder in htdocs for each site.
Believe me I've been googling and I've looked at some 'solutions' (for example changing the httpd.conf for example, would mean changing it each time i want to view a different site....) but nothing has helped. What things should I be checking out?
Edits
LINKS FORMATTING
href="/css/homeAreaStyle111.css"
data="/svg/linkedbutton.svg"
Are you preceeding your links with a slash? Ie
<a href=/page.htm>
If so those links will be pointing to the site root. Try replacing with ex
<a href=page.htm>
or
<a href=./page.htm>
In case you have your website at C:xampp/htdocs/mysite then your links will look like:
href="/mysite/css/homeAreaStyle111.css"
data="/mysite/svg/linkedbutton.svg"
Related
I have set up a site with ExpressionEngine, and put the fonts and images folder in the root of the site, and they work absolutely fine for pages that are template group home pages (with the house icon) but they suddenly dont work on pages that are added to the same template group as new templates...
the paths look like this in the html:
href="fonts/Anybody.woff2" or url(img/header_stripes_light.svg)
where should I copy the fonts and images folders to make them also work in subtemplates? I couldn't find anything useful in their documentation about this issue.
That's an easy one! make those url's absolute and you're fine.
Do it like this: href="/fonts/Anybody.woff2" or url(/img/header_stripes_light.svg)
Your paths are relative to the page now, so without the initial "/"
I have followed Drupal's tutorial on how to successfully run a Windows server using xampp. I think I've done everything right, but when I go to my website, it goes to mywebsite/xampp.
Does anyone know what I need to do to solve this?
Which folder did you put your website files? What address did you type in the address bar? If using localhost or any other domain which redirects there, be sure you rename any index.php or index.html in the server root folder (htdocs). This is because most servers look for any file named this way when visiting any server folder and will automatically display that page when it finds it.
In this case since you freshly installed xampp, their homepage is probably set to show by default
For example look at the picture. This is the index.php file in the htdocs folder. At the top you can see I've added a header to redirect to somewhere else. Below I commented out the code that was defaulted by the xampp installation, which pretty much said to relocate to the xampp/ directory (which then loads the index file there). If it failed to go there, you should see the message at the bottom
Something is wrong with your xampp installation :-(
If you're being redirected to the xampp/ directory you simply need to rename or edit the index.php file in the htdocs folder.
Ideally you should make a separate folder for your website in the htdocs folder, something like htdocs/myWebsite.
You can name your homepage either index.html or index.php (depending on which language you use) and then go to localhost/myWebsite and it will automatically load your homepage.
my wife have a joomla 2.5 site
She claims that she has done nothing except, installing and and subsequently uninstalling Koowa plugi, Ninja plugin and Ninjaboard component.
Anyway after that the joomla 'path' have changed such that between the domain name and the path rendered by HTML, the joomla server now seems to insert "/index.php" or "/index.php/menu-item-name"
for example clicking a link like the following:
<a href="images/some_folder/xxx.JPG">
points to something like: http://www.domain.contry/index.php/fun/images/some_folder/xxx.JPG
how to we change the 'global path settings' such that
<a href="images/some_folder/xxx.JPG">
points to
http://www.domain.contry/images/some_folder/xxx.JPG
NB: my joomla and php skills are very basic :)
Update:
I think the problem something like this:
all the image paths used to be 'absolute' and are now relative, so if I am in 'index.php/some-menu' and click 'images/xxx.jpg' then it resolves to 'index.php/some-menu/images/xxx.jpg', she has all her images in the image folder, is there some way make all image paths 'absolute' instead of relative in joomla?
because changing 'images/xxx.jpg' to '/images/xxx.jpg' with firebug fixes the problem...
if it is not possible in joomla... how bad do you think it is to:
download the sql database
and run a regex akin to
s/<.+?=\"(images)\/[\w\s]+?\.[\w\d]+)\".*?>/\/$1/g
Look in your global configuration under the Site tab for your SEO settings. Make sure you have URL rewriting enabled, and follow the directions in the tooltip to rename htaccess.txt (Linux servers) or web.config.txt (Windows servers) if necessary.
If you get a server error on the site at this point, try uncommenting RewriteBase / in .htaccess.
edited again to say NEVERMIND because problem is no longer occurring(?)
EDITED TO ADD LINKS
my site:
http://www.mainstreetmassage.co/index.html - relative path to stylesheet
http://www.mainstreetmassage.co/index2.html - absolute path to stylesheet
copy site on same host account:
http://
www.mcdanielcounseling.com/index.html
this "copy site" is the site that got changed last night by deleting just the html and css for the blue ribbon that had the custom fonts inside it - but the actual font files are still in the "copy site"'s css folder
The 2 sites are in 2 separate folders and don't share any resources.
END OF EDIT
2 custom fonts used to work fine no matter what browser. I had a little trouble initially getting FF to work but sorted that a while ago by putting the font files "loose" in the css folder, not in a folder of their own, and it's worked fine since then.
All the links I made absolute, because that seemed to make the page faster, but that too was a while ago and no trouble until this morning.
The only thing I can think of that's changed is, I set up a second site on same hosting account or server, it was at first just a copy and paste of my site but I've been slowly changing it for the owner, and last night, in that site's folder only, I deleted not the custom font files, but just the references to them in the CSS file, plus the HTML element that used them - but only in the 2nd site, not mine.
Then all of the sudden today the fonts are not displaying in FF at all, on my site. I fixed it sort of by following another answer on here that suggested making the urls relative for the css, and that worked, but I am wondering what made it happen and if I need a more permanent fix.
Thank you
Working with PHP. I want to display the images which are in xampp folder not in htdocs (which will be root of the website). How to go about it? I have tried <img src="../../image.jpg", and also tried with src=/image.jpg, not working. Given the total path as src="E:/xampp/image.jpg" still not working. What may be wrong. The file is .php
You can't access pictures (or files) outside of htdocs on a webpage.
There are probably ways to retrieve the image from a directory "lower" than htdocs with PHP (depending on your open_basedir-restrictions), store them somewhere else and let the img-tag display them or really mess with your server settings to allow access ... but why don't you just place the images somewhere in htdocs (or a subdirectory), where they belong?
You cant access images/css sheets etc outside htdocs folder
Make a folder for images in htdocs and use those