1

I've tried the tips here:
404 on Every Template and TPL group
and here:
404 error on all templates but homepage after removing index.php

I can access the index by using the default url (on my localhost, port 8040)

http://localhost:8040

But I cannot access any other templates:

http://localhost:8040/cursos   
http://localhost:8040/programas

Here is my .htaccess

RewriteEngine on 
RewriteCond $1 ^(cursos) [NC] 
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteEngine on 
RewriteCond $1 !^(images|js|css|crmi_cms|themes|favicon\.ico|robots\.txt|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

And here is my template directory structure:

expressionengine    
    templates    
        default_site    
            cursos.group    
                index.html    
            programas.group    
                index.html    
            site.group    
                index.html    

site.group/index.html is default site home page.

I've even tried moving the cursos.group index to the site.group and renaming it to cursos.html. Still nothing...

Please help me.

  • 1
    why do you have "RewriteEngine on" in the middle of .htaccess? It must be on the top. And try to add "RewriteBase /". Also, just for sure - are you sure that your server is used .htaccess? What systems you use on the server? Apache/iis/NGINX+php-fpm? – Max Lazar Nov 22 '13 at 4:34
  • I have updated the .htaccess and it still won't serve the page, says "The requested URL /cursos was not found on this server." – MB34 Nov 23 '13 at 3:34
  • BTW, using Wampserver 2.2 – MB34 Nov 23 '13 at 3:54
5
+100

Can you get the templates to render if you leave index.php in your URL? eg

localhost:8040/index.php/cursos

If so then it is your .htaccess. Max is right about the order of your .htaccess file. Also, you could try adding a '?' in your RewriteRule directly after index.php

eg RewriteRule ^(.*)$ /index.php?/$1 [L] 

A fairly reliable method of removing your index file is in the EE docs here - have you tried it? http://ellislab.com/expressionengine/user-guide/urls/remove_index.php.html#exceptions

| improve this answer | |
  • 1. No it does not show with index.php in the URL. 2. I tried with a ? and still no go. 3. The link you gave is in one of the answers I tried. – MB34 Nov 23 '13 at 3:29
  • Actually, I just tried it again with index.php like this: /index.php/cursos and it served the page. Not sure why it worked this time. I changed the .htaccess to this ellislab.com/expressionengine/user-guide/urls/… and it still doesn't work without index.php. Adding the ? didn't help either. – MB34 Nov 23 '13 at 3:53
  • Try looking at this solution, it worked for this WAMP user: stackoverflow.com/questions/10938330/… – BellamyStudio Nov 23 '13 at 11:12
  • @Pennzizzle - just tried in httpd-vhosts.conf, not work. It is already set like that in httpd.conf. – MB34 Nov 24 '13 at 17:02
  • Also tried adding RewriteBase / still not working. – MB34 Nov 24 '13 at 17:03
1

This finally worked. I double checked that mod_rewrite was installed, too.

# Removes index.php from ExpressionEngine URLs
RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond $1 !^(admin|images|system|themes|index\.php|admin\.php) [NC]
RewriteCond $1 ^(cursos|programas|testimonales|salondelafama|enhonor|registro|resources|calendario|TNA) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
| improve this answer | |
1

To add to this now old topic, I had a similar issue. While the original poster found the solution for their case, in my case the answer from BellamyStudio worked: https://stackoverflow.com/questions/10938330/unable-to-remove-index-php-on-expressionengine-wamp-installation#answer-11906830, updating the vhost.conf file, or in my case the file /etc/apache2/sites-available/default, to "AllowOverride All" for the directory where my site was hosted.

<Directory /the/path/to/my/webroot/>
  AllowOverride All
  Order allow, deny
  Allow from all
</Direcory>

In other words, my apache configuration was completely ignoring my htaccess file. Setting "AllowOverride All" made apache use the htaccess file in the webroot.

Side note: An easy test to see if your webserver is ignoring your htaccess file is to just add some junk data (a random string of letter for example) to the top of the htaccess file in the webroot, and then reload the website. If the result is an error (usually an "internal server error") then your webserver IS using the htaccess. Otherwise, the webserver IS NOT using the htaccess.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.