Zend framework image and CSS Path Problems

Source: Internet
Author: User

After learning the Zend framework, I still did not understand the path problem, so that the image could not be displayed normally. I searched Google for a solution. The specific solution is as follows:

 

Use the following code in. htaccess to replace the original code.

# Zend framework Rewrite Rules
Rewriteengine on
Rewritecond
% {Request_filename }! -F
Rewriterule. * index. php
#
Security considerations: List contents are not allowed
Options-Indexes
# PHP settings
Php_flag magic_quotes_gpc
Off
Php_flag register_globals off
Php_flag short_open_tag on

When accessing:

For example, my css.css file is under public/CSS. The website directory is the webapp under the website root directory.

The CSS reference in the template file is:

Absolute reference address:/webapp/public/CSS/css.css

Relative reference address: the address displayed in the current browser is the reference directory.

For example, the current access address is http: // localhost/webapp/


Then our relative reference address is :. /Public/CSS/css.css

For example, the current access address is changed to http: // localhost/webapp/index.


The reference address is :.. /Public/CSS/css.css

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.