zend framework .htaccess rewrite rule


genetrix
 Share

Recommended Posts

Hi,

everything fine , my site is up , however when I click on any link, it showd 404 error ..........

my bootstrap is fine I think, there is some trouble in .htaccess .. could anyone help what definitions should be with .htaccess ?

on my localhost it runs fine :

my .htaccess on localhost is :

# Rewrite rules for Zend Framework

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule .* index.php


# Security: Don't allow browsing of directories

Options -Indexes


# PHP settings

php_flag magic_quotes_gpc on

php_flag register_globals off

php_flag short_open_tag on

Link to comment
Share on other sites

There are quite a few other ways to do it:


RewriteEngine on
RewriteRule !.(js|ico|gif|jpg|png|css)$ index.php
[/CODE] Just sends it all to index.php except for js,ico,gif,jpg,png and css. Then you also have
[CODE]
[COLOR=#000000]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L][/COLOR]

For any file it finds.

Link to comment
Share on other sites

  • 2 years later...

I am new to hosting services. So can you tell me how do i add zend framework for my website.

I have put my project (structure: zend recommended structure) in public_html folder, then the link is becoming DOMAIn/Project name/public/ and any links all the links are assuming 'public' as suffix.

Can someone help me with some detailed (newbie) information please.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share