<p>So it turns out I needed to have the "Options +FollowSymLinks" block above the craft rewrite rule in my htaccess. See comments above.</p>

CC BY-SA 3.0
2016-03-21T12:28:14.187Z
2016-03-21T12:28:14.187Z
Matthew Carleton
<p>I have followed the instructions for removing index.php and it works on all pages with the exception of pages with channels. So I would see <a href="http://www.example.com/index.php?p=news/2016/news-title" rel="nofollow">http://www.example.com/index.php?p=news/2016/news-title</a>.</p>

<p>I also added the <code>'omitScriptNameInUrls' =&gt; true</code>, in the <code>general.php</code> file. </p>

<p>Here is what I have in my <code>.htaccess</code> file</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;

&lt;IfModule mod_deflate.c&gt;
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/svg+xml
&lt;/IfModule&gt;

&lt;IfModule mod_headers.c&gt;
    &lt;FilesMatch "\.(eot|otf|tt[cf]|woff2?)$"&gt;
        Header set Access-Control-Allow-Origin "*"
    &lt;/FilesMatch&gt;
&lt;/IfModule&gt;

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
</code></pre>

CC BY-SA 3.0
2016-03-16T18:23:59.583Z
Are you using Craft's stock `.htaccess` file?
Brad Bell
CC BY-SA 3.0
2016-03-17T12:35:37.013Z
Ive revised my answer to show what I have in there.
Matthew Carleton
CC BY-SA 3.0
2016-03-17T21:41:07.810Z
Is the 2nd block "Options +FollowSymLinks" just a SE formatting issue, or is that part of the same .htaccess code in the first chunk?
Brad Bell
CC BY-SA 3.0
2016-03-18T17:21:23.650Z
ya it's a redirect for the www
Matthew Carleton
CC BY-SA 3.0
2016-03-18T23:05:56.857Z
Try moving the www rewrite rule above the Craft rewrite.
Brad Bell
CC BY-SA 3.0
2016-03-19T13:45:16.987Z
yup that did the trick!
Matthew Carleton
CC BY-SA 3.0
2016-03-19T15:13:23.403Z
Awesome... would you mind adding that as an official answer?
Brad Bell
<url><config>
index.php in url for just channel pages
# index.php in url for just channel pages

(Asked by: username_0 on 2016-03-16)

I have followed the instructions for removing index.php and it works on all pages with the exception of pages with channels. So I would see http://www.example.com/index.php?p=news/2016/news-title.
I also added the 'omitScriptNameInUrls' => true, in the general.php file. 
Here is what I have in my .htaccess file

    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]



    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/svg+xml



    
        Header set Access-Control-Allow-Origin "*"
    


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

**Tags:** url, config
> **Comments:**
> **username_1**: Are you using Craft's stock `.htaccess` file?  
> **username_0**: Ive revised my answer to show what I have in there.  
> **username_1**: Is the 2nd block "Options +FollowSymLinks" just a SE formatting issue, or is that part of the same .htaccess code in the first chunk?  
> **username_0**: ya it's a redirect for the www  
> **username_1**: Try moving the www rewrite rule above the Craft rewrite.  
> **username_0**: yup that did the trick!  
> **username_1**: Awesome... would you mind adding that as an official answer?  

---

## 1 answers

### Answer by username_0 on 2016-03-21. Score: 0 | Accepted answer

So it turns out I needed to have the "Options +FollowSymLinks" block above the craft rewrite rule in my htaccess. See comments above.


---

