Welcome Guest, Not a member yet? Register   Sign In
html page instead of the view
#1

ok , so i kind of solved my problems but i have a last one ,a big one :
my file structure is
/public_html/
/assets/
/css/....
/otherfolders/
/system/
/application/
...CI folders...
.htaccess
index.php
somepage.html

if i go to www.mysite.com everything works il,it takes me to the index function of home controller who gives me the home.php view
but if i go to www.mysite.com/home/index/ or www.mysite.com/home/all_newsletters/ it does not take me to the functions of home controller ,instead it shows me the somepage.html page and i do not understand why

i created a test controller and make it to some echo or var dump testing ,even make his index function to return an existing view but with no luck ,i get url not found

what is the problem ,where could be ? if i change some .htaccess rules i make home controller methods to work but test controller still does not work and breaks other links too
Reply
#2

file structure is like this and i am using CI 1.7.3
Code:
/public_html/
        ->/assets/
                       - - >/css/....
       ->/otherfolders/
       ->/system/
                     - - > /application/
                      - - >...CI folders...
       ->.htaccess
        ->index.php
        ->somepage.html
Reply
#3

Show your htaccess content Smile
Best VPS Hosting : Digital Ocean
Reply
#4

i will show it , but i can't right now ,i am in the phone
Reply
#5

Hello,

If it can help, here is my htaccess file in local :

Code:
Options -Indexes
RewriteEngine on
RewriteCond $1 !^(index\.php|assets/|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

Unfortunately, my first hoster ran a different version of Apache than my local version, so I had to make some updates of htaccess to make the website working. Here is the code :

Code:
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_URI} ^sys.*
   RewriteRule ^(.*)$ /index.php?/$1 [L]
   RewriteCond %{REQUEST_URI} ^app.*
   RewriteRule ^(.*)$ /index.php?/$1 [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
   ErrorDocument 404 /index.php
</IfModule>
Reply
#6

thank you , i will try it
Reply
#7

this is the .htaccess

Code:
# =============================================================
# PREVENT DIRECTORY LISTING
# =============================================================

IndexIgnore *                # IF DIRECTORY LISTING IS ON it will hide all the files if index is not found
#IndexIgnore *.gif *.jpg    # IF DIRECTORY LISTING IS ON it will hide all the gif and jpg files if index is not found


# =============================================================
# LIMIT UPLOAD SIZE
# =============================================================

php_value upload_max_filesize 50M
php_value post_max_size 50M


# =============================================================
# DEFAULT CHARSET
# =============================================================

AddDefaultCharset UTF-8


# =============================================================
# PHP PROCESS .html FILES
# =============================================================

AddType application/x-httpd-php .html


# =============================================================
# DISABLE HOTLINKING (PROTECT BANDWIDTH) - Replace YourSite.com
# =============================================================

Options +FollowSymlinks
RewriteEngine on

# RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com/.*$ [NC]    
# RewriteRule \.(gif|jpg)$ - [F]


# =============================================================
# WWW FIX
# =============================================================
DirectoryIndex index.php

#redirect mysite.com catre www.mysite.com
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301,NC]

#redirect mysite.com/index.php/ catre www.mysite.com
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

# =============================================================
# REWRITES
# =============================================================

RewriteRule ^images/$ http://www.mysite.com/ [L,R=301]

# =============================================================
# CODE IGNITER
# =============================================================

# -- MAIN --
#eliminare index.php din url
RewriteBase /
RewriteCond $1 !^(index\.php|import|sitemap[0-9]+\.xml.gz|cgi-bin/|ibill_postback\.php|emailreg60bb2ab7a204d7f2\.htm|ibill_postback1\.php|assets|cidip|opx|imageuploader|images/|css/|js/|swf/|bbc|bbc/|chat|forum|forum/|bbclone|bbclone/|googlea8c09c054542a23c\.html|googlea8c09c054542a23c\.html|license\.php|robots\.txt|dev/|ImageUploader6\.5\.jar|ImageUploader6\.5\.cab|ImageUploader6\.jar|ImageUploader6\.cab|test\.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

# =============================================================
# EXPIRES HEADERS AND ASSET COMPRESSION
# =============================================================
<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(gif|jpg|png)$">
    ExpiresDefault "access plus 10 years"
    FileETag none
</FilesMatch>

<FilesMatch "\.(js|css)$">
    ExpiresDefault "access plus 7 days"
    FileETag none
</FilesMatch>
</IfModule>

# compress all text and html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml
# Or, compress certain file types by extension:
<FilesMatch "\.(js|css)$">
    SetOutputFilter DEFLATE
</FilesMatch>



# =============================================================
# DENY/ALLOW CERTAIL IP ADDRESSES
# =============================================================

Options -Indexes
<Files 403.shtml>
    order allow,deny
    allow from all
</Files>
Reply
#8

i tweaked the .htaccess file and now i get : The requested URL /home.html/index was not found on this server.
Reply
#9

Sorry but I'm lost here... I don't think I can help you more about it, I'm afraid my knowledge of htaccess is too poor !
Reply
#10

do not add the ending / on the method
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB