<p>I solved the problem and am writing it down for future people encountering the same problem.</p>

<p>Add the following configuration to the your <code>craft/config/general.php</code> config file:</p>

<pre><code>'omitScriptNameInUrls' =&gt; true
</code></pre>

<p>URLs will start to work fine.</p>

CC BY-SA 3.0
2017-01-26T14:12:42.843Z
this does not affect actionUrl method it seems...
Manticore
CC BY-SA 3.0
2014-09-27T15:04:50.647Z
2014-09-27T18:28:26.040Z
2014-09-27T18:28:26.040Z
Maria Stellini
<p><strong>Edit:</strong> Quick answer (as per <a href="https://craftcms.stackexchange.com/users/1016/ritterknight">RitterKnight's</a> comment)... just add <code>RewriteBase /</code> to the top of your <strong>.htaccess</strong> file in the root of your public/public_html directory.  </p>

<hr>

<p>I am on the same type of shared GoDaddy server, and continued to experience the same issue regardless of wether 'omitScriptNameInUrls' was set to true. I would get an "Internal Server Error" on all pages, apart from the homepage.</p>

<p>I have since <a href="https://stackoverflow.com/questions/17101600/htaccess-not-working-on-godaddy/23519720#23519720">found a solution</a> which is specifically tailored to GoDaddy sufferers. My .htaccess file now looks like this:</p>

<pre><code>DirectoryIndex index.php
AddDefaultCharset utf-8

RewriteEngine on
Options +FollowSymlinks -MultiViews -Indexes   

RewriteBase /

&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;
</code></pre>

<p>Success! I now have a Craft installation on a GoDaddy shared server, with clean-urls working!</p>

CC BY-SA 3.0
2015-07-12T16:49:05.787Z
I'm guessing the addition of the line ``RewriteBase /`` is what's making this work. IIRC the last time I used GoDaddy, it ignored ``DirectoryIndex`` and used index.php as the default anyway but YMMV.

You don't need the ``RewriteEngine On`` directive in there twice—you have it once in the ``IfModule`` block—where it usually is—and again above it, outside the block. By convention, ``RewriteBase /`` usually sits below inside the ``ifModule`` block on the off chance mod_rewrite is turned off or not installed.
RitterKnight
CC BY-SA 3.0
2015-07-12T13:45:51.703Z
2016-08-15T21:09:34.437Z
2017-04-13T12:51:00.160Z
Mark Notton
<p>I have lord knows how many sites on GoDaddy (too many). The key to it is <code>RewriteBase</code>. Just add it to the default <code>.htaccess</code> and you're all set.</p>

CC BY-SA 3.0
2015-07-12T14:21:23.320Z
Nice, thank you. So those first 4 lines in my comment are unnecessary.
Mark Notton
CC BY-SA 3.0
2015-07-12T14:03:10.260Z
2015-07-12T14:03:10.260Z
Bryan Redeagle
<p>For some reason the CraftCMS URL rewrite is not working on GoDaddy shared hosting server. </p>

<p>Currently by .htaccess file looks like this</p>

<pre><code>Options +FollowSymLinks -Multiviews
&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;
</code></pre>

<p>Has anyone encountered this problem? Can someone help me solve this?</p>

<p><strong>Update</strong></p>

<p>I am not sure any more if this a url rewrite problem. As when I access an entry such as <a href="http://aspaceboydream.com/comic/so-this-is-me">http://aspaceboydream.com/comic/so-this-is-me</a>, it loads correctly. But when I use the function:</p>

<pre><code>url('comic')
</code></pre>

<p>to construct the urls of the different channels, the URLs are being constructed as <a href="http://aspaceboydream.com/index.php?p=comic">http://aspaceboydream.com/index.php?p=comic</a></p>

<url><config><siteurl><setup>
URL rewrite not working
# URL rewrite not working

(Asked by: username_0 on 2014-09-27)

For some reason the CraftCMS URL rewrite is not working on GoDaddy shared hosting server. 
Currently by .htaccess file looks like this
Options +FollowSymLinks -Multiviews

   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]


Has anyone encountered this problem? Can someone help me solve this?
Update
I am not sure any more if this a url rewrite problem. As when I access an entry such as http://aspaceboydream.com/comic/so-this-is-me, it loads correctly. But when I use the function:
url('comic')

to construct the urls of the different channels, the URLs are being constructed as http://aspaceboydream.com/index.php?p=comic

**Tags:** url, config, siteurl, setup

---

## 3 answers

### Answer by username_0 on 2014-09-27. Score: 9

I solved the problem and am writing it down for future people encountering the same problem.
Add the following configuration to the your craft/config/general.php config file:
'omitScriptNameInUrls' => true

URLs will start to work fine.

> **Comments:**
> **username_1**: this does not affect actionUrl method it seems...  

---

### Answer by username_2 on 2015-07-12. Score: 5

Edit: Quick answer (as per RitterKnight's comment)... just add RewriteBase / to the top of your .htaccess file in the root of your public/public_html directory.  

I am on the same type of shared GoDaddy server, and continued to experience the same issue regardless of wether 'omitScriptNameInUrls' was set to true. I would get an "Internal Server Error" on all pages, apart from the homepage.
I have since found a solution which is specifically tailored to GoDaddy sufferers. My .htaccess file now looks like this:
DirectoryIndex index.php
AddDefaultCharset utf-8

RewriteEngine on
Options +FollowSymlinks -MultiViews -Indexes   

RewriteBase /


   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]


Success! I now have a Craft installation on a GoDaddy shared server, with clean-urls working!

> **Comments:**
> **username_3**: I'm guessing the addition of the line ``RewriteBase /`` is what's making this work. IIRC the last time I used GoDaddy, it ignored ``DirectoryIndex`` and used index.php as the default anyway but YMMV.  You don't need the ``RewriteEngine On`` directive in there twice—you have it once in the ``IfModule`` block—where it usually is—and again above it, outside the block. By convention, ``RewriteBase /`` usually sits below inside the ``ifModule`` block on the off chance mod_rewrite is turned off or not installed.  

---

### Answer by username_4 on 2015-07-12. Score: 3

I have lord knows how many sites on GoDaddy (too many). The key to it is `RewriteBase`. Just add it to the default `.htaccess` and you're all set.

> **Comments:**
> **username_2**: Nice, thank you. So those first 4 lines in my comment are unnecessary.  

---

