Welcome Guest, Not a member yet? Register   Sign In
Separate folder for non-CI website
#1

[eluser]bertcarremans[/eluser]
Hi,

I have a website for my webdesign company, created with CI. However, I would like to have a folder preview in which I can show the website in preview for my customers. Some of these websites are not created with the CI framework, but with plain HTML and CSS.

So the preview folder exists in the root next to the CI folders of my website. Unfortunately when trying to view the non-CI website I get an error that the page was not found.

Do I have to change something in the htaccess to make this work?

Thanks!
#2

[eluser]OliverHR[/eluser]
Check you .htaccess and add a rule like this:

Code:
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#3

[eluser]bertcarremans[/eluser]
Thanks,

I already have these lines in my htacces files, but it does not work.
Do you perhaps have another idea what this might be?
#4

[eluser]John_Betong_002[/eluser]
Try this:

.htaccess
Code:
# Prevent directory listing
# On your web server, when a directory do not have an index file,
# Apache automatically create a list of all files from the current directory.
# If you do not wish that anyone can see which files are on your server,
# just add the following code to your .htaccess file
# to prevent automatic directory listing.
Options -Indexes

# to reveal files
Options +Indexes

# to hide all files
IndexIgnore *

# to hide some files
IndexIgnore *.zip *.jpg *.gif
 
 
#5

[eluser]bertcarremans[/eluser]
Hi, thanks for the responses, but I think I did not explain my problem clear enough.

My website is made with CI and is put in the root folder. In the folder “preview”,
which is also in the root, I put a website that is not created with CI, but with simple HTML and CSS.
So this preview website consists of and index.html and a CSS file.

When I go to http://www.mywebsite.com/preview I get the error that the page is not found.

I tried all of the above mentioned suggestions in the htacces file in the preview folder, but I always get
the same error.

Does anyone have another idea?
Thanks in advance!
#6

[eluser]John_Betong_002[/eluser]
What is the name of the html file?

If they do not exist then create two files, index.html and index.php both in the preview folder and post the following:

Code:
// .htaccess
  DirectoryIndex index.php index.html

// ./preview/index.html
  <h1>index.html</h1>

// ./preview/index.php
  &lt;?php /* */ ?&gt;
  <h1>index.php</h1>
&nbsp;
edit: added preview path
#7

[eluser]bertcarremans[/eluser]
Excellent! Thanks a lot John!




Theme © iAndrew 2016 - Forum software by © MyBB