Yii Framework Forum: htaccess problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

htaccess problem Rate Topic: -----

#1 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 13 October 2009 - 07:02 AM

I have a problem to hide index.php
I write at main.php -config file
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'urlSuffix'=>'.asp'
),

and at .htacess
Options +FollowSymLinks IndexIgnore / RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} 
!-f RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^.*$ /index.php [L]

Put there is a page not found error when I hide index.php at url.
What is wrong, I have debian and the site is at a subfolder of the root.
Posted Image
0

#2 User is offline   Ismael 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 02-June 09
  • Location:Brazil

Posted 13 October 2009 - 07:20 AM

I think it is index.php and not /index.php

Anyway, try this:

[code]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
0

#3 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 13 October 2009 - 07:38 AM

View PostIsmael, on 13 October 2009 - 07:20 AM, said:

I think it is index.php and not /index.php

Anyway, try this:

[code]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Thank you,
But again an error 404 page not found...
The strange is that at windows vista (xampp) the site is ok.
The site is at subfolder of root and it does not have a domain name.
Posted Image
0

#4 User is offline   Harry Tang 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 10-August 09

Posted 13 October 2009 - 07:57 AM

my htacess
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php


Work fine with xampp for Linux, but xampp for windows not work.
0

#5 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 13 October 2009 - 08:01 AM

I am wondering if I have to 'install' mode_rewrite ,my php has not pdo_mysql and I have to install it also
Posted Image
0

#6 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 14 October 2009 - 04:41 AM

I see that apache does not read .htaccess at all.
For instance I go to mysite/protected and I see the files but at protected there is a .htaccess with deny from all
What is wrong?
Posted Image
0

#7 User is offline   Ismael 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 02-June 09
  • Location:Brazil

Posted 14 October 2009 - 08:36 AM

View Postdimis283, on 14 October 2009 - 04:41 AM, said:

I see that apache does not read .htaccess at all.
For instance I go to mysite/protected and I see the files but at protected there is a .htaccess with deny from all
What is wrong?


Check in apache conf if htaccess overwrite is enabled:

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None


Change None to All
0

#8 User is offline   dimis283 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 277
  • Joined: 24-January 09

Posted 15 October 2009 - 07:55 AM

I set at http.conf this
<Directory />
             Options FollowSymLinks
             AllowOverride All
#            Order deny, allow
#            Deny from all
</Directory>

but it does not work,what is wrong, as I see mode_rewrite is enable
[Edit]I solved it, is was not enable
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users