hi...
i want to make a news portal website and for this purpose i installed a web server machine to be able testing the website.
the drupal website path is http://localhost/drupal-testpage.
so far all went well.
the problem:
when i make a story, in the image tag i give the following image path: "../files/image.jpg"
and also check the option to publish the story in the main page too.
the image are displayed in the node/x page, but when i go to the main page the image is missing.
yes, i know the image path "../files/image.jpg" are not found in the main page, works only in the node/x page.
i must use absolute path to display the image correctly everywhere. in my example "/drupal-tespage/files/image.jpg" does the job.
but when i finish the website and want to upload it to a webserver provider i must change all the links of the website.
is any solution to avoid this? any module, script, how to or something?
thanks...
Comments
One solution is to set up
One solution is to set up and access your local Drupal site not as a subdirectory but as a subdomain, for example http://drupal-test.localhost or simply http://drupal-test (ServerName "drupal-test", DocumentRoot same as now). Without a subdirectory, "/files/image.jpg" should always work just fine in both sites. To do this you will need to add a virtual host in your Apache configuration, like this:
http://drupal.org/node/111866#comment-192025
Another solution is to avoid typing any kind of file URLs in the content, and to use always filters such as http://drupal.org/project/inline or http://drupal.org/project/img_filter for displaying images and http://drupal.org/project/pathfilter for links. So, you will type something like [internal:filename] and the filter will display the right path.