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

rewritre rule to mask index.php? gives bad redirections with a ?

How Do I?

groupe_edh's avatar
groupe_edh
2 posts
10 years ago
groupe_edh's avatar groupe_edh

Hi, i’ve been searching and searching some redirections issues.

My htaccess is build to mask the index.php in URL

Options +FollowSymLinks
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/iceberg/.* [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][/code]

But some old links are not redirected correctly.
I've got this exemple : 

[code]RewriteRule ^index.php?/communiquer/article/1033/ http://www.mywebsite.com/archives/archives/article/1033 [R=301,L]

This line is written BEFORE the EE rewrite rule, so it should do the work.

instead i’ve got this :

www.mywebsite.com/index.php?/communiquer/article/1033/ redirect 301 www.mywebsite.com/?/communiquer/article/1033/ with a 404 !

If i put this line AFTER the EE rewrite rule, same thinh happens If i change the rewrite rule with

RedirectPermanent /?/communiquer/article/1033/ http://www.mywebsite.com/archives/archives/article/1033

AFTER or BEFORE EE rewrite rule, same thing happens…

Any idea how i can get a proper redirection of old URI ?

Thanks.

       

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.