ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Url Rewrite via htaccess dont work

December 13, 2013 10:43am

Subscribe [1]
  • #1 / Dec 13, 2013 10:43am

    bob1983

    2 posts

    Hi!

    Hope to post in the right section!
    im severals weeks struggling my head with an htaccess + EE2 problem

    My goal is very easy but sooo far away!

    I need to do a rewrite rules for all url in order to delete 2 segments from urls.
    My current urls are

    http://www.mysite.com/main_group/tpl_name/permalink_title.html
    i need to rewrite in order to obtain

    http://www.mysite.com/permalink_title.html

    Looks my htaccess works correctly for index.php and redirect 301 also.

    If i put a rule like:

    RewriteRule ^permalink_title.html$    /main/tpl_pagina/permalink_title.html [L,R=301]

    everythings works but if i do

    RewriteRule ^permalink_title.html$    /main/tpl_pagina/permalink_title.html [L]


    i cant access the page correctly

    Actually i’ve no redirect in my template and i want to use htaccess file only.

    Any suggestion is appreciated! down here my htaccess file

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    ##rule for testing purpose
    RewriteRule ^campi-di-applicazione.html$    /main/tpl_pagina/campi-di-applicazione [L]
    
    
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    
    RewriteRule ^(.*)$ /index.php/$1[L]
    
    </IfModule>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases