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

i need some advice/help with template routes ... i think

How Do I?

andrew001's avatar
andrew001
136 posts
9 years ago
andrew001's avatar andrew001

So my url structure is similar too:

mysite.com/products/ballpoint-pen

mysite.com/products/ballpoint-pen/details

mysite.com/products/pencil

mysite.com/products/pencil/details

Client wants the segment “products” gone.

so the url would read:

mysite.com/ballpoint-pen

mysite.com/ballpoint-pen/details

mysite.com/pencil

etc.

Will the template route tool in EE provide me with this functionality? Products segment is a template group

       
FountainInternet's avatar
FountainInternet
53 posts
9 years ago
FountainInternet's avatar FountainInternet

I think you’ll need to modify your .htaccess file. If you’ve created an .htaccess file as per the instructions, try modifying it by adding the two lines before the </IfModule> below:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /

 # Removes index.php from ExpressionEngine URLs
 RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
 RewriteCond %{REQUEST_URI} !/system/.* [NC]
 RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

 # Directs all EE web requests through the site index file
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ /index.php/$1 [L]
 
 # Remove /products from product URLs
 RewriteRule ^products/(.*)$ /$1 [L]
</IfModule>
       

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.