Jump to content
Larry Ullman's Book Forums

Hiddng Index.Php Form


tom7254
 Share

Recommended Posts


                            

I am new to YII and I have tring to hide the index.php from
the web site. I am not sure what .htaccess you are talking about. I
tried adding the mod_rewrite to the .htaccess in the yii_cms/protected
folder. I also add the .htaccess to the folder /xampp/htdocs. But when I
run the site it tells me the following:



    Server error!







The server encountered an internal error and was

unable to complete your request. Either the server is

overloaded or there was an error in a CGI script.



 





If you think this is a server error, please contact

the webmaster.

 





    Error 500



    localhost

Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7


    Am I not editing the correct .htaccess file?

                            
                       

 

Link to comment
Share on other sites

It should be where your index.php file is stored.

 

 

 
<ifModule mod_rewrite.c>
# Turn on the engine:
 
RewriteEngine on
 
# Do not perform redirects for files and directories that exist:
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
 
# For everything else, redirect to index.php:
 
RewriteRule . index.php
 
</ifModule>
  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

AAArrrrgggg!!!

 

Okay, I'm actually working through the book.  So I made a new yii site.

 

www.mysite.com/music/thesiteforthebook.

 

but my url is:

http://10.10.10.105/music/index.php/site/index

 

sucks.

 

.htaccess is

http://10.10.10.105/music/.htaccess

 

and it says (copied from the book):

 

<ifModule mod_rewrite.c> 

# Turn on the engine: 

RewriteEngine on

# Don't perform redirects for files and directories that exist

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d

# For everything else, redirect to index.php:

RewriteRule ^(.*)$ index.php/$1 

</ifModule>

 

 

I know that this will not effect the first index.php (so I need a solution for that but....)

 

Would someone please hit me in the head with a 2X4?

 

Thank you.

Link to comment
Share on other sites

'showScriptName'=>false,

 

(it is not included in my default install and I did not read the Yii Book carefully enough.

 

Once added all worked as it should.

 

Thanks to all.

 

(and I hit myself on the head with a 2X4 - thanks to my friend Chris for pointing this out)

Link to comment
Share on other sites

 Share

×
×
  • Create New...