Answers.Body: <p>Check out: <a href="https://craftcms.com/support/remove-index.php" rel="nofollow noreferrer">Removing “index.php” from URLs</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-20T20:44:01.123Z
Answers.Text: Perfect. 'omitScriptNameInUrls' was commented out in my multi environment config. Thanks Andrew!
Answers.UserDisplayName: Shift2Design
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-20T20:17:59.557Z
Answers.LastActivityDate: 2017-11-20T20:17:59.557Z
Answers.UserDisplayName: andrew.welch
Body: <p>I have a Craft site where I need to redirect any traffic to www (including dev.lakesideohio.com). The rule seems to be working but for some reason the url gets changed to using index.php with query string which I am not using.</p>
  
  <p>For example <a href="https://mysite.com/news" rel="nofollow noreferrer">https://mysite.com/news</a> goes to <a href="https://www.mysite.com/index.php?p=news/" rel="nofollow noreferrer">https://www.mysite.com/index.php?p=news/</a> instead of <a href="https://www.mysite.com/news" rel="nofollow noreferrer">https://www.mysite.com/news</a>.</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  
  # Redirect to www
  RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
  RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L] 
  
  # 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]     
  </code></pre>
  
  <p></p>
  
Tags: <htaccess>
Title: Simple Craft htaccess Help
ThreadText: # Simple Craft htaccess Help
  
  (Asked by: username_0 on 2017-11-20)
  
  I have a Craft site where I need to redirect any traffic to www (including dev.lakesideohio.com). The rule seems to be working but for some reason the url gets changed to using index.php with query string which I am not using.
  
  For example <https://mysite.com/news> goes to <https://www.mysite.com/index.php?p=news/> instead of <https://www.mysite.com/news>.
  
  ```
  <IfModule mod_rewrite.c>
  RewriteEngine On
  
  # Redirect to www
  RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
  RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L] 
  
  # 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]     
  
  ```
  
  **Tags:** htaccess
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-20. Score: 1 | Accepted answer
  
  Check out: [Removing “index.php” from URLs](https://craftcms.com/support/remove-index.php)
  
  > **Comments:**
  > **username_0**: Perfect. 'omitScriptNameInUrls' was commented out in my multi environment config. Thanks Andrew!  
  
  ---
  
  