Hot answers tagged

5

You can't delete index templates, so you'll have to include {redirect='404'} on those templates to force them to 404.


5

If you are running from localhost:8888, then locally you are essentially running these sites from subdirectories. So the .htaccess you are using (RewriteRule ^(.*)$ /index.php/$1 [L]) is sending requests to http://localhost:8888/index.php. Try the second exception from the user guide: RewriteRule ^(.*)$ index.php/$1 [L] Notice there is no / in front of ...


5

This is a known bug in EE 2.9.0: https://support.ellislab.com/bugs/detail/20471/site-index-template-is-rendered-after-the-404-template The fix from that thread: Open system/expressionengine/libraries/Template.php and find this code on line 2236: ee()->output->out_type = "404"; ee()->output->set_output($out); ee()->output->_display(); ...


4

When using the Pages module, the URL Title is not used and should not be fed to to the {exp:channel:entries} tag. If you remove that parameter from the tag and change dynamic="yes" or remove the dynamic parameter altogether, it will pick up the correct page entry automatically. You'll also need to make sure the entry with the Page URI set has the correct ...


4

You might read this article Guide to 404 Pages with ExpressionEngine It would help you great.


4

This looks like a bug on the no_results conditional, to me. May I suggest you something? Let's change your approach to this. Look at the docs. You should take advantage of the parsing order and do not let your code run if you can avoid. So, use simple conditionals around the channel:entries variable pair. This way, in the two first situations, the parsing ...


4

If you are using EE 2.7+ there is a new current_query_string global variable you can test against. {if current_query_string} {redirect="404"} {/if} Or, for versions less than EE 2.7... Install the Mo Variables Extension and enable the setting that gives you a {query_string} variable. Then in your homepage template you can do {if query_string} {...


4

You need to use the require_entry parameter: {exp:channel:entries limit="1" require_entry="yes" [...]} {if no_results} {redirect="404"} {/if} [...] {/exp:channel:entries} This parameter make the {if no_results} conditional available.


3

You can accomplish that by doing the following: Make a template group called 404.group and in that template group create an index.html template (this will be your 404 template) Set "Enable Strict URLs" to "Yes" in your Global Template Preferences For the "404 Page" setting choose "404/index" (the template you created in step 1 above), again in your Global ...


3

It looks like your 404'd page works with index.php: http://warpedcoders.com/charlie/index.php/news/page_content So, try this for your .htaccess rewrite: <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On ## Removes index.php RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...


3

Take the standard method and add in your subfolder name before index.php in the RewriteRule. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /SUBFOLDER/index.php/$1 [L] </IfModule>


3

You are missing the opening { on the href's tag, and {title_permalink} has an underscore _ not a dash. <li><a href="{title_permalink="site/essay"}">{title}</a></li> See EE Docs on Permalinks


3

I don't think the issue is with the friendly URL's, however you can test this by removing that block from the htaccess and typing the index.php part into your URL : http://www.example.com/index.php?foo=bar Another thing to check is that ExpressionEngine itself is not clearing the get parameters, which can happen as all ee actions are submitted to the home ...


3

Check and make sure your /index.php is in place and configured correctly.


3

Finally resolved this. On a whim I decided to try the URL /en and that had the same effect too so that meant it had to be language related, with the original problem being with 'de'. In my htaccess, which is where I started in the first place, I found a reference to a multi-lingual snippet, which included en|fr|es and wouldn't you know it....de. Removing ...


2

Unfortunately there wont really be an easier way than with Freebie. It's designed for this very purpose when you need EE to ignore certain URL segments and comes in very handy when dealing with Structure because of the way it deviates from EE's native URL handling. In the case of both strict URL handling and Structure you definitely need to break those URL ...


2

For SEO purposes, I don't think it's a good idea to return a 301 redirect when you want to return a 404 error. When you do {redirect="404"} then EE serves the 404 template with a proper HTTP 404 status response. When you do {redirect="404/index"} then EE responds with a HTTP 301 status redirect header. Google Analytics and Webmaster Tools track when a URL ...


2

Adding an additional segment on to the end of a Pages URI will trigger a 404. I recommend using the Freebie extension to set an ignored segment, in your case "thank-you." This will allow you to redirect to /contact/thank-you and show the contact page while still using the second segment for any conditionals. {if freebie_2 == "thank-you"} <p>Your ...


2

http://mysite.com/about/non-existent will load the http://mysite.com/about template. This is because EE looks at that second segment automatically for a number of things... if there isn't a template name there it will try to load an entry with that url_title into the /about template. To stop this behavior, add this into the /about template: {if segment_2 ...


2

Check your htaccess file. It's possible you have a 404 redirect statement there too which should be removed.


2

Robson's suggestion is on the money. Another approach would be to use the awesome IfElse add-on so parsing is less of an issue. Using your example, it would look something like this: {exp:ifelse parse="inward"} {if segment_4 != "" || segment_2 != "staff-bio"} {redirect="404"} {if:elseif segment_2 == "staff_bio"} {if segment_4 == ...


2

Ha ha, found it! Removing index.php code in the .htaccess file also needed updating. Original RewriteRule to remove index.php: RewriteRule ^(.*)$ /index.php?/$1 [L] New RewriteRule needs the sub-folder added to the RewriteRule: RewriteRule ^(.*)$ /subfolder/index.php?/$1 [L] Note: the question mark after index.php depends on a server setting, so ...


2

The problem is that the redirectee plugin use the native PHP header function which not support the 404 code. In fact it is a little bit strange to send a 404 with the header. Therefor you have to use a 302 code, the 404 page will send a 404 code on his page. As for redirecting with the 404 code, you have the think of this QA: User: Hey, do you have ...


2

Bchavez, Try to check the configuration files of ExpressionEngine, I guess there is a problem about the server path and or the url path settings. Did you install EE on the root of your server, or inside a folder? If it's inside a folder you have to configure the paths.


2

First, make sure you have enabled "Strict URLs" and chosen you 404 template in in the control panel. Control Panel Location: Design > Templates > Template Preferences Take a look at Global Template Preferences in the ExpressionEngine User Guide for more information.


2

Loading the home page in 404 mode is EE's default functionality. Unless you configure/code otherwise this is just what happens. Can't you add this to your home page template? {if segment_1 !=""} {redirect="404"} {/if} This assumes you have a template specified as your 404 template in the area of the CP that Alex provided a screenshot of.


2

In template global preferences set "allow templates to be saved as files". Then edit a template from the control panel template manager, and check the checkbox to save the template as file. When you click save a notice should appear (top of window) that the file is saved. If EE is somehow not able to save the file, it will show a notice. Most of the times ...


2

Firstly, can you confirm that the admin.php file actually still present on the server? Secondly, you mentioned the disallowed key characters message. Are you setting 2 lots of Google Analytics cookies? Third party services may also be setting Analytics cookies. I had this problem recently with an old Typekit kit which resulted in one of the cookies being ...


2

You're already using require_entry, so the final step is to use the no_results check. {if no_results} {redirect="404"} {/if}


2

Are you sure mod_rewrite is installed & enabled? My guess is no!


Only top voted, non community-wiki answers of a minimum length are eligible