2022 Developer Survey is open! Take survey.
6 votes
Accepted

Remove trailing slash from URLs

This is what I usually have in my .htaccess for this (goes right after RewriteBase /): # Remove the trailing slash to paths without an extension RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{...
user avatar
  • 2,831
6 votes
Accepted

NSM htaccess generator error EE2.8.1

actually I don't use NSM htaccess generator , but I can help you with this problem. first thing update to the last version , if you have the last version and still have this problem you can solve it ...
user avatar
5 votes
Accepted

ExpressionEngine 404 Not found - /index.php/products was not found

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 ...
user avatar
  • 2,255
3 votes

After removing index.php from URLs, 404s on every template except homepage

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 ...
user avatar
3 votes
Accepted

How to redirect empty url to a specific page

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/...
user avatar
  • 5,900
3 votes
Accepted

Querystrings on 'home' url go to 404 page

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?...
user avatar
  • 2,418
3 votes
Accepted

Are .htaccess files required for EE install?

No, .htaccess file is not needed for EE install. If you don't make .htaccess file then also EE will run. But, it is advisable to keep .htaccess file for removing the index.php from URL, leverage ...
user avatar
3 votes
Accepted

how to redirect from website.com/index to website.com

You probably can find all you need in the ExpressionEngine documentation which discusses this issue and provides some sample code.
user avatar
  • 3,562
3 votes
Accepted

htaccess - Best practice-version for EE5?

You will need that rule, nothing has changed with the requirement of using mod_rewrite to remove the index.php portion of your URL for your site installation. You still need to direct all non-file/...
user avatar
  • 5,900
2 votes

index.php removal in .htaccess doesn't work when on https

Try this :: 1.) Go to your SSL configuration file : /etc/httpd/conf.d/ssl.con 2.) Find your Virtual Host : <VirtualHost_default_:443> 3.) Write down : Path to your directory <Directory "/...
user avatar
  • 21
2 votes

Howto trim incoming URL's

Using the info from the link provided by AllinOne https://stackoverflow.com/questions/1649435/regular-expression-to-limit-number-of-characters-to-10 you should be able to solve this. The information ...
user avatar
  • 7,176
2 votes

htaccess redirect to url without www with site in a sub-directory

Problem is solve, I did change the code this way: # Removes redirect to url without www RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/namesubdirectory/$1 [R=301,L]
user avatar
  • 289
2 votes

Remove index.php - interior pages are blank

Are you sure mod_rewrite is installed & enabled? My guess is no!
user avatar
  • 1,701
2 votes

CE Cache Static not serving cached home page

I think I've found the issue and solution. It seems sometimes mod_dir will be setup to do it's thing before mod_rewrite. This means that %{REQUEST_URI} for the homepage could end up being index.php ...
user avatar
2 votes

Are .htaccess files required for EE install?

htaccess is not needed, however, to remove the index.php from the url you'll need it Also for setting cache control headers it's usefull as wel as for caching and gzip output/extraction
user avatar
1 vote

Clean 301 redirects using an .htaccess that also removes index.php

This is what we use to redirect a directory to a subdomain RewriteRule ^trade* http://trade.domain.com/ [R=301,L]
user avatar
1 vote

Clean 301 redirects using an .htaccess that also removes index.php

Try a RedirectMatch rule and see what you get: RedirectMatch 301 ^/store/?$ http://store.example.com
user avatar
  • 5,900
1 vote

Remove 'home' folder from home page url

OOOOk... so did you try setting a default template group? If you set your default template group to "Home", the index template in their will be resolved at www.example.com as well as www.example.com/...
user avatar
  • 5,900
1 vote

Querystrings on 'home' url go to 404 page

I had a situation where my web host required the use of a '?' after index.php in the .htaccess RewriteRule like this: RewriteRule ^(.*)$ /index.php?/$1 [L] And changing the values of $config['...
user avatar
  • 1,156
1 vote

Removing index.php but leaving subdirectory

The documented approach to running EE from a subdirectory rather than the root, is to just remove the slash preceding index.php like so… RewriteRule ^(.*)$ index.php/$1 [L] Further, the ...
user avatar
  • 149
1 vote

htaccess rules for subdomains?

In that case you just need to change the last line of the standard .htaccess rules. (That link is worth reading in its entirety.) <IfModule mod_rewrite.c> RewriteEngine On ...
user avatar
  • 17.4k
1 vote

URL Redirecting Issues

One quick way you can tell if it's your .htaccess is try updating it to the following. I got this from Nicu at EE Zoo and have been using it for all of my builds here on out: # Apache configuration ...
user avatar
1 vote
Accepted

append .xml to EE template

I believe the best is a redirect on the server. It's faster and easier. If the server runs Apache, you can add to the .htaccess file: RewriteRule ^/media/podcast.xml http://domain.com/media/podcast [...
user avatar
  • 6,108
1 vote

Redirects from old site using queries to new EE site

Did you actually mean this? RewriteCond %{QUERY_STRING} range.php?type=baropt&item=01 [NC] RewriteRule ^(.*)$ http://domain.com/range/bars/led-bar? [R=301,L] You should use RewriteCond, not ...
user avatar
  • 2,831
1 vote

Bets way to protect direct link?

Take a look at Protected Links. This will allow you to limit link usage by IP, Member group, Member ID as well as hotlinking protection (and more I think!) You can also create links via the CP or have ...
user avatar
  • 7,176
1 vote
Accepted

Redirect from Member/Register is not working

Try using: RewriteRule ^member/register$ http://sitexyz.com/ [R=301,NC,L] and make sure to place it before any index.php rewrite rules in your root htaccess file.
user avatar
1 vote
Accepted

Howto trim incoming URL's

Ok, thanks to both @foamcow and @AllInOne I was able to weed out the solution. So here is what works: RewriteBase / RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/([a-zA-Z0-9\-/_]{0,75})(.*)$ http://www. ...
user avatar
1 vote

Howto trim incoming URL's

Thinking on my feet here. I don't think you can do this via htaccess so what I would do is ensure that these urls end up at a special template (you might do it on a 404 page but I'm not sure of the ...
user avatar
  • 7,176
1 vote

HTACCESS issues with multiple redirects

On line 11, change: RewriteRule ^(.*)$ /index.php?/$1 [L] to RewriteRule ^(.*)$ /index.php/$1 [L] And see if that works. According to https://ellislab.com/expressionengine/user-guide/urls/...
user avatar
  • 35
1 vote

Remove question mark in URL with "Force URL query strings" enabled

I had a similar issue to this previously. Removing the "?" in the last RewriteRule solved the issue. Change in your .htaccess file: RewriteRule ^(.*)$ /index.php?/$1 [L] To: RewriteRule ^(.*)$ /...
user avatar
  • 56

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