Yii Framework Forum: Hiding index.php not working - Yii Framework Forum

Jump to content

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

Hiding index.php not working on apache 2.4 Rate Topic: -----

#1 User is offline   Sonu Rai 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-December 11
  • Location:England

Posted 05 April 2012 - 10:27 AM

Hi,

I enabled it the main config file.
put the .htaccess file with the correct code.
I'm getting "not found" errors when loading pages.

This is my server config:


LoadModule alias_module modules/mod_alias.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so

ServerName localhost:80
ServerAdmin admin@localhost
ServerSignature Off
Listen 80

AcceptFilter http none
HostnameLookups Off
ExtendedStatus Off

ErrorLog logs/error.log
ErrorLogFormat "[%t] [%l] %7F: %E: %M"
LogLevel error

AddHandler cgi-script .cgi .pl

LoadModule php5_module /.sys/php/php5apache2_4.dll
AddType application/x-httpd-php .php
PHPIniDir /.sys/php

<Directory />
<IfModule setenvif_module>
SetEnvIf Request_URI "^/w00tw00t" BLOCK
Require env BLOCK
</IfModule>
Options -Indexes +FollowSymLinks -SymLinksIfOwnerMatch
Require all granted
AllowOverride all
</Directory>

<Files ~ "^\.ht">
Require all denied
</Files>

<IfModule alias_module>
Alias /adminer /.sys/adminer
<Directory /.sys/adminer>
Options All
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /apc /.sys/apc
<Directory /.sys/apc>
Options All
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /memcache /.sys/memcache
<Directory /.sys/memcache>
Options All
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /mongodb /.sys/mongodb
<Directory /.sys/mongodb>
Options All
AllowOverride AuthConfig
Require all granted
</Directory>
Alias /phpinfo /.sys/php/info.php
<Directory /.sys/phpinfo>
Options All
AllowOverride AuthConfig
Require all granted
</Directory>
</IfModule>

<IfModule deflate_module>
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
DeflateCompressionLevel 9
<IfModule filter_module>
AddOutputFilterByType DEFLATE text/html text/plain text/xml
</IfModule>
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
<Directory />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<IfModule setenvif_module>
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:avi|flv|mov|mp3)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|7z)$ no-gzip dont-vary
</IfModule>
</Directory>
</IfModule>

<IfModule dir_module>
DirectoryIndex index.php index.pl index.html index.htm
</IfModule>

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" common
<IfModule setenvif_module>
# Don't log requests from loopback interface
SetEnvIf Remote_Addr "127\.0\.0\.1" DONTLOG
CustomLog logs/access.log common env=!DONTLOG
</IfModule>
<IfModule !setenvif_module>
CustomLog logs/access.log common
</IfModule>
</IfModule>

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

<IfModule vhost_alias_module>
Include conf/vhosts.conf
</IfModule>


Can you see any problems?
0

#2 User is offline   mauricioschneider 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 16-August 10
  • Location:Santiago, Chile

Posted 05 April 2012 - 10:48 AM

Are you using a vhost? If yes, also include the vhost configuration to the post.
1

#3 User is offline   Sonu Rai 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-December 11
  • Location:England

Posted 05 April 2012 - 01:36 PM

View Postmauriciorivera, on 05 April 2012 - 10:48 AM, said:

Are you using a vhost? If yes, also include the vhost configuration to the post.

Ohhh myyy goddd!

Dude thank you so much.

I was using the default zwamp install (http://zwamp.sourceforge.net/).
I wasn't using a vhost, but there was one there already.

And I found the "AllowOverride None" and changed it to all.
Works. Is that safe though? I just want to override the rewrite stuff.
0

#4 User is offline   mauricioschneider 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 16-August 10
  • Location:Santiago, Chile

Posted 05 April 2012 - 01:45 PM

I'm not sure about that, but I think AllowOverride FileInfo should suffice
1

#5 User is offline   Sonu Rai 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-December 11
  • Location:England

Posted 05 April 2012 - 02:16 PM

View Postmauriciorivera, on 05 April 2012 - 01:45 PM, said:

I'm not sure about that, but I think AllowOverride FileInfo should suffice


Works fine with just that. Thanks mate.
0

#6 User is offline   mauricioschneider 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 16-August 10
  • Location:Santiago, Chile

Posted 05 April 2012 - 02:21 PM

You're welcome :)
0

#7 User is offline   agus kianto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 07-January 13

Posted 16 August 2013 - 03:47 AM

For example I create a web app, should I built a ghost?
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