We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

After removing index.php from URLs, any segment will load homepage...help!

Development and Programming

Nmodo's avatar
Nmodo
3 posts
13 years ago
Nmodo's avatar Nmodo

ExpressionEngine is loaded into the server root (ie. public_html, not a sub-folder).

Here’s the rewrite block from my .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    # If 404s, "No Input File" or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)
</IfModule>

I have template groups for the various pages, so my URL’s look like: domain.com/<template_group>

However, if someone types in domain with a nonexistant template group (eg. domain.com/morecowbell), it will still load the home page—rather than firing a 404 or other server error. Can anyone help me troubleshoot this?

I noticed this because Google has indexed domain.com/blog somehow, which doesn’t exist on my site, it just loads the home page.

       
the3mus1can's avatar
the3mus1can
426 posts
13 years ago
the3mus1can's avatar the3mus1can

Look at the uri_protocol in your config/config.php file. It is probably set to auto which looks at the query string for the route path. Switch it to either REQUEST_URI or PATH_INFO. One of those, depending on the web server config, should fix your problem.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.