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

Removing Index.php with Addon-Domain

How Do I?

jfriedmann's avatar
jfriedmann
13 posts
10 years ago
jfriedmann's avatar jfriedmann

Hello,

I’m running an expression engine installation in an addon-domain of my server, and I’m having trouble getting the .htaccess index.php removal working. Every page returns my homepage.

The code I’m using is the following (which is the same as the code on the main domain)

Removes index.php from ExpressionEngine URLs

    RewriteCond $1 !\.(gif|jpe?g|png|js|css)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

If 404s, “No Input File” or every URL returns the same thing

make it /index.php?/$1 above (add the question mark)

Obviously, I tried with the questionmark, same result, it’s not working.

       
airways's avatar
airways
154 posts
10 years ago
airways's avatar airways

You might need to put the addon domain in the RewriteRule, depending on how they implemented the additional hosts. It sounds like they are not real vhosts and instead are directories inside your main directory, with mod_rewrite used to server those requests. I know this is the case with Arcustech (commonly used for EE hosting), and several others.

RewriteRule ^(.*)$ /example.com/index.php/$1 [L]
       
jfriedmann's avatar
jfriedmann
13 posts
10 years ago
jfriedmann's avatar jfriedmann
You might need to put the addon domain in the RewriteRule, depending on how they implemented the additional hosts. It sounds like they are not real vhosts and instead are directories inside your main directory, with mod_rewrite used to server those requests. I know this is the case with Arcustech (commonly used for EE hosting), and several others.
RewriteRule ^(.*)$ /example.com/index.php/$1 [L]

No luck there… that causes a 500 internal server error.

       
jfriedmann's avatar
jfriedmann
13 posts
10 years ago
jfriedmann's avatar jfriedmann

Bump… any other suggestions?

       
jfriedmann's avatar
jfriedmann
13 posts
10 years ago
jfriedmann's avatar jfriedmann

Sorry… so putting that full path did in fact work.

The difficulty now, is that the URL is changing in the address bar to show index.php… instead of just rendering it behind the scenes like normal.

Note that in order to get it to work, I had to do the following: RewriteRule ^(.*)$ http://www.example.com/index.php/$1 [L]

       
jfriedmann's avatar
jfriedmann
13 posts
10 years ago
jfriedmann's avatar jfriedmann

Bumping this one again, anyone?

       

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.