• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
static page loader with style

I've implemented a static page loader with style. Just a little code, that works. But only on my desktop hosting. When I uploaded everthing to a remote hosting routing does not work. First the code...

in routes.php:
$route['([a-zA-Z]+)\.html'] = "documents/load_static/$1";


function load_static($filename) {

If I use index.php version, it works on the remote host also. (www.example.com/index.php/static_page.html). But I want www.example.com/static_page.html to work. What can be the problem at hosting site?

Did you also upload your .htaccess?

If so, make sure your webhost allows the use of that file.
This is done by allowing overrides in the directive

<Directory "/long/path/to/your/site">
        AllowOverride All

I uploaded .htaccess file. Now working.

Wonderful Smile

Sorry.. "Now working." should read as "Not working." Smile)

But now I found my problem. Anyhow, I don't know why, my "static_page.html" becomes "static_page_html". Do you know the reason behind this? Is it an apache issue or CI has anything with this?


My hosting has some security measures I guess. _GET[] variables are converted too. So I changed my regular expression in routes.php to

$route[’([a-zA-Z]+)(\.|_)html’] = “documents/load_static/$1”;

Now It's working fine.

can you explain me what htaccess information I should put to implement this ?
say my static files are in www/system/views/static .
currently to manage to avoid the index.php i have this htaccess file

RewriteEngine on
RewriteCond $1 !^(index\.php|medias|phpmyadmin|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

thanks for your help.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.