Expression Engine - template page not showing - .htaccess

I have two pages on a site that I just completed that are no longer showing. I am running EE 2.2.2 and use .htaccess to hide the index page.
There are several templates in the same directory, all but two of them show correctly. For example:
This shows correctly: http://southernlivingplants.com/landscape
While these two do not:
http://southernlivingplants.com/grower
http://southernlivingplants.com/retailer
I get the following error message:
Index of /retailer
Parent Directory
Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server
at southernlivingplants.com Port 80
The problem I see is that neither /retailer or /grower are directories.
Here is the htaccess code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
I would appreciate some help in figuring this out.

Alas, user error. Someone else had created folders of the same name, which were in conflict with the template names.

If I put index.php in the URL the pages seem to come up, so it's probably an .htaccess issue. Have you been through the official docs for removing it? There's several options: http://expressionengine.com/user_guide/general/remove_index.php.html
Another idea...you said that retailer and grower are all in the same directory? EE doesn't generally work like that unless you're using Structure. Template groups define new top level directories and each template inside is a sub directory (other than the index). So in this case if they're all in the landscaping directory the urls' would be /landscaping/retailer and /landscaping/grower. Hope that helps!

It looks like you are using the "File and Directory Check" method for the .htaccess file for ExpressionEngine.
Are retailer and grower template groups or templates in EE?
Have you tried removing the ? after the index.php in the rewrite rule? What hosting company are you using?
I have had best success with the "Exclude" method myself.
http://expressionengine.com/wiki/Remove_index.php_From_URLs#Exclude_List_Method
You essentially put in the ReWriteCond the folders / files that you do NOT want EE to parse as if it's a template. So, your /images, /system, /themes, etc directories, if you end up having one for /js or another application, you just add them to that line. (Make sure to escape the periods.) I suggest trying that method. That way everything else will definitely go through EE.

Related

How do i change the .htaccess on cPanel's Online File Manager (ByetHost)?

I'm using ByetHost as my website's FTP service, i configure everything (besides uploading the stuff) via ByetHost's Vista Panel, which has a Online File Manager where i presume i could edit the .htaccess.
However when i arrive at the File Manager, i can't seem to find the .htaccess file, and there is also a lack of a Settings button too.
Here is what the File Manager looks like: (the htdocs is where all my website's stuff is at)
I know ByetHost and/or whatever this unknown File Manager is not well known, but i'd like to ask anyways if there's anyone that could help me on how to configure my .htaccess. I would appreciate it.
I had this issue too, and couldn't find any settings or otherwise.
So what I simply did was:
Just created a new file and named it .htaccess!
And a quick test, I put in the following to allow access to my .html pages without actually typing the extension:
RewriteEngine on
RewriteRule ^(.+)\.html$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ /$1.html [NC,END]
And it worked successfully.

Joomla - htaccess Redirects Error

I've had a Joomla 2.5.28 site for quite a while now and recently changed hosting providers. On the new server I managed to get Joomla updated to 3.2.7 and get it to run normally.
Now for the tricky part:
On my previous hoster I had a second installation being kind of the gateway to the other site. It just lets you select language and that's it.
My domain is www.cyclingtoserve.at with Joomla Main being /joomla and Joomla portal being /3.1
I figured by adding a REDIRECT rule from / to /3.1 I could get the portal up and running again. Sadly not.
This is what I get:
I thought I could undo this by deleting the .htaccess file. The problem lives on though.
I've tried just about everything. Help is VERY MUCH appreciated!
Edit01: A bit more info may be interesting.
The Joomla install is in /joomla while the other page is in /3.1
The .htaccess file however was in the root directory.
Edit02: I have managed to remove the wrong redirection. Question is: What is the correct way to redirect people from www.cyclingtoserve.at to /3.1? (without it showing up in the address)
Edit03: Here is a graphical representation (FTP) of the folder structure.
ftp
In order to avoid the redirect loop, you need to first check to see if your are already in the /3.1/ folder. Try this:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/3.1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://%{HTTP_HOST}/3.1/$1 [L,R]
Sadly I've had to give up using .htaccess for the redirection.
I would have loved the recommended way (and still would like to know how).
Solution:
index.html in root has the following lines:
<frameset rows="100%" frameborder=0 framespacing=0 border=0>
<frame src="http://cyclingtoserve.at/3.1/" name="Content" noresize>
<noframes>
It may be the quick and dirty way of dealing with this issue, but it works.
If you can reproduce the same results with .htaccess, I'd love to tag it as an answer.

Make subfolder act as root for the site contained in that subfolder

I have tried to find a solution to my problem but I have not been able to find any questions/answers that address this specific issue.
I've been tasked with moving a website that was built under its own domain - www.example.com - to now reside in a subdirectory of another site - www.otherSite.com/example.
The site to be moved was built with many references to $_SERVER['DOCUMENT_ROOT'] as well as many relative URLs that start at the root. For example:
<?php include $_SERVER['DOCUMENT_ROOT'] . '/nav.php'; ?>
and
/images/logo.jpg
The problem, of course, is that all of those references to the root for the site moving to the subdirectory will reference www.otherSite.com thereby breaking all of those URLs.
I'm hoping that there's a some way, possibly using .htaccess in the subdirectory, to set that subdirectory as the root for the site in that subdirectory.
Note - I am on shared hosting and do not have access to httpd.conf.
Thanks very much.
On www.otherSite.com host place this code in DocumentRoot/.htaccess:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?domain\.com/example/ [NC]
RewriteRule ^((?!example/).*)$ /example/$1 [L,NC,R=301]
Have you tried redirecting to the sub-folder from your cpanel?, have you check if some of the settings were stored in a database for the site if any?
Please add more codes from the site so we can understand how the codes look like.

CodeIgniter Path Issue

I am use Codeigniter to creat my site. it is a huge site with a lot of contents.
i use the default welcome controller for all pages.
the path is like this now
http://mydomain.com/index.php/welcome
and my folder structure is like this
/root
/codeigniter Application folder
/controller
/view
/static/
/images/
/css/
/pdf/
.htaccess
because i am doing the content first, so all the images are set to absolute patch (http://mydomain.com/static/images/foldername/pc.jpg)
now when i use the rewrite to remove "inde.php" and "welcome"
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|system|pdf|sitemap\.xml|profile.htm|^([A-z,0-9,_,-]+).asp|(.*)\.pdf|phpadmin)
RewriteRule ^(.*)$ /index.php/welcome/$1 [L]
all css and image file are not accessible anymore. I have nearly a thousand pages with images. I don't have the time to change the page one by one. the deadline is coming, please help.
thanks
Have you tried adding the css-folder to your excluded rewriteconditions?
RewriteCond $1 !^(index\.php|images|robots\.txt|system|pdf|sitemap\.xml|profile.htm|^([A-z,0-9,_,-]+).asp|(.*)\.pdf|phpadmin)
Does not seem to exclude the folder css from rewriting (see images is excluded).
Try something like
RewriteCond $1 !^(index\.php|images|css|robots\.txt|system|pdf|sitemap\.xml|profile.htm|^([A-z,0-9,_,-]+).asp|(.*)\.pdf|phpadmin)
Good luck
I think the problem lies with your .htaccess file. We have a similar setup, and that url living outside of the application directory is available just as you have it with a direct url relative to its path. Check out the wiki at http://codeigniter.com/wiki/mod_rewrite for the correct way to set up your .htaccess file.
Edit to clarify: The url http://mydomain.com/static/images/foldername/pc.jpg should work. something about your .htaccess file is wrong.
RewriteCond $1 !^(static|index.php|images|robots.txt|system|pdf|sitemap.xml|profile.htm|^([A-z,0-9,_,-]+).asp|(.*).pdf|phpadmin)

.htaccess - How to hide the internal directory used by subdomains?

I installed a small FTP space for my classmates which allows them to upload school related documents to my server. After the files have been uploaded, they can be easily accessed via a subdomain i.e. ftp.mydomain.com
Everything is working fine, the files can be downloaded and everything works properly.
There are two things which still annoy me though:
If you enter ftp.mydomain.com you see Index of /my_internal_directory instead of something like Index of /
Once you enter a sub-directory and click the Parent Directory link it will redirect you to ftp.mydomain.com/my_internal_directory/ as well
Is there any way to hide my_internal_directory ?
This is the content of my .htaccess file so far:
RewriteEngine on
RewriteCond %{HTTP_HOST} ftp\.mydomain\.com
RewriteCond %{REQUEST_URI} !^/my_internal_directory/
RewriteRule ^(.*)$ /my_internal_directory/$1 [L]
Any help would be greatly appreciated.
If you are using linux server then you can remove read permission for folder my_internal_directory
If not resolve, try to add:
Options -Indexes
on top of the file.
If still doesnt resolve please post your .htaccess file... :)

Resources