12

There are 3 things that should fix this. Assign your 404 error template in your "Global Template Preferences" which can be found at Design > Templates > Template Preferences In your products template, add the require_entry="yes" parameter to your channel:entries tag Inside that channel:entries tag add the following to redirect incorrect requests to the 404: ...


8

Thanks for nudge Derek. I was totally unaware that the site was running as a FastCGI process. This is the default with (mt) dv 4.0 & Plesk 11.0.9 when creating new hosts. Which maybe explains other user's issues with removing index.php at MediaTemple I switched it back to Apache and removed the ? from the rewrite rule and the redirects are working ...


7

Not with a tag, but with a PHP snippet you can, you have some options: Using EE's built on function <?php ee()->functions->redirect('{external_link}'); ?> You'll need PHP parsing on, if you want to use the {external_link} tag you'll have to set it to run on Output Location Header redirect. With the above you may get some screen artifacts as ...


6

I've never used EE before version 2 so not 100% sure this will work, but hopefully it helps. Inside your weblog entries tag (I am assuming it is a weblog entries tag, if it is not, post what it is here) put the following code: {if no_results} {redirect="404"} {/if} This also assumes you have a 404 page set up in your configuration. This may not work, ...


4

Since you are hard-coding an entry_id in your channel:entries tag in your products/index template, and as long you don't need any additional url segments to trigger other behavior (such as pagination or for dynamically loading another entry), you could just do this: {exp:channel:entries channel="products" entry_id="12"} {if segment_2 != ""} {...


4

Use the Structure global variable {structure:page:uri} which is the same as EE's native "page_url" variable.


4

According to the bug reported by Mark Drzycimski, for those who don't have an Ellislab account, the solution is listed as follows: In /system/expressionengine/libraries/Redirect.php on line 50, change: "<p><a href='".$_GET['URL']."'>".$_GET['URL']."</a></p>\n</body>\n</html>"; to: "<p><a href='".$_GET['URL']."'...


3

I know there is Detour Pro which is for doing redirects. Since we are on the topic of affiliate and for future reference there are these add-ons which are for setting up your own affiliate links for your users FWIW: Affiliator Affiliate Plus


3

Detour Pro is an option for this, especially since it provides you with a bit of reporting on each URL redirect. However, it's meant as an alternative to doing 301 and 302 redirects in htaccess - not sure if it would be the best option for URL shortening. Another option is DM Shortee, which is more strictly a URL shortening service and not a redirect tool (...


3

I've run into similar issues in the past, and honestly I gave up on htaccess in the end as I never could get it to work exactly as I intended. A much easier solution I found was using an add on to force the redirect instead, doing it this way I gained direct control of pages needed redirecting in templates instead. I used an addon called Force SSL, http://...


3

Problem solved. If you are already logged in and log in again the return does not WORK


3

You need to use %{QUERY_STRING} RewriteCond %{QUERY_STRING} ^option=com_user&view=reset&Itemid=14$ RewriteRule ^(.*) /contact? [L,R=301]


3

My friend... I'm afraid your syntax is incorrect. Place this rule after your index.php rewrites (at the end of the standard EllisLab htaccess file): RedirectMatch 301 ^/?$ http://www.example.org/todays-info This is the magic you seek. The second parameter of a RedirectMatch is a regular expression.


3

Yes! Use the redirect variable in your template. From the documentation: {redirect='news/local' status_code="301"}


2

Michael - Have you enabled 'Force Query Strings' in Admin > System Preferences > Output and Debugging Preferences (this is from memory, sorry if the breadcrumb is a bit off). I suspect that you just need to have a question mark after index.php - you can remove it with .htaccess, but that is the most common cause here and usually happens on installations ...


2

The Detour Pro addon should do what you need. Detour Pro handles simple redirects like this/old/page to this/new/page The PathFinder addon seems like it will add redirects automatically. Configure ExpressionEngine to automatically perform an HTTP 301 redirect when the URL slug (url_title) for an entry is changed. Want to allow content editors to change ...


2

If you look at function no_results() in ./system/expressionengine/libraries/Template.php you will see that when a 404 template is defined as simply "404" within a redirect tag, then the 404 template referenced by the config value site_404 is fetched and parsed. The template is not returned by the function but my guess is that it populates the property $EE->...


2

This should do it: $accept_language = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']); $lang = $accept_language[0]; echo $lang; switch ($lang) { case 'en-US': case 'en': echo 'Success!'; break; default: echo 'Count on En'; }


2

The only thing you normally need for 404 with a require_entry="yes" and strict urls enabled is: {if no_results}{redirect="404"}{/if} Can you just try this on a clean template? As others have said, a broader context could help debugging this. EDIT: if, as per your comment, you know you should only have two segments, then simply modify the code as follow to ...


2

You can't use {if}...{if:else}...{/if} (always executed, output thrown away after conditional check) but have to use switchee or something similiar. {exp:switchee variable="{segment_2}" parse="inward"} {case value="{url_title}"} I should re-direct {url_title} | {entry_id} -- <? echo({entry_id}); ?> {/case} {case default="Yes"} ...


2

Okay, I found the error (If anyone's intrested): I must not write RedirectMatch 301 instead I simply have to write Redirect. So simple.


2

Per comments: The problem was caused by the .htaccess file, and not ExpressionEngine.


2

If you've actually changed the template_group/template structure in EE and you just want to catch old requests and ensure they go to the new location then I'd always look to keep it top-level with .htaccess for this. First of all ensure that the mod_rewrite module is enabled and the rewrite engine is enabled: Options +FollowSymLinks RewriteEngine on Then ...


2

If you're not opposed to an add-on, I used Detour Pro on a site with many many URL reroutes and loved it. You can use wildcards with it to save time as well.


2

See if you were bitten by this bug: http://support.ellislab.com/bugs/detail/19378


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

Updated: The issue caused by the trailing slash redirect happening after your EE index.php rewrite. You need to have this redirect happen before rewriting to index.php. (Note: almost always, you want all redirects to happen before the rewrite to index.php.) So, the simplest way to correctly remove the trailing slash, that shouldn't cause you issues, looks ...


2

I think it's probably doable. It may be a process of elimination to work out all the kinks as you go, but no core hack should be needed. I'd suggest you move the system directory out of the main site's document root first. You can remove admin.php from the main site. And copy it over to the admin subdomain. And you can rename it whatever you like. You'll ...


2

I know it'd be hacking core, but wouldn't throwing a rel="nofollow" attribute on the anchor negate the effectiveness of this?


2

check out this add-on http://devot-ee.com/add-ons/mo-variables and it's "Page Tracker" variables that you can use!


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