0

I have an .htaccess file that has been working perfectly. However, I just moved the website to a shared host and everything stopped working.

Here is my .htacces:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/preview/([^/]+)/?$ preview.php?c=$1&m=$2&i=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/page/([^/]+)/?$ index.php?c=$1&m=$2&p=$3 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?c=$1&m=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?c=$1 [L]

I can't be sure but I think the problem is that hosting account is not at the root level. Meaning I have one domain pointing to my hosting account, but then this domain www.website.com is pointing to the /website folder on the hosting account.

The error message is just:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache Server at crstrains.com Port 80

And there is nothing generated in the error logs.

I expect www.website.com/Policies to equal www.website.com/index.php?c=Policies, and it used to. Not anymore. How can I fix this?

sharf
  • 2,123
  • 4
  • 24
  • 47
  • Have you tried adding a `RewriteBase /website/` right after the `RewriteEngine on` statement. http://stackoverflow.com/questions/704102/how-does-rewritebase-work-in-htaccess – Cyclonecode Aug 03 '14 at 04:37
  • @KristerAndersson I hadn't tried that but it doesn't seem to help. I did try modifying the number of `/([^/]+)`s and got it to throw a 404 instead, saying that /website/website/index.php cannot be found... – sharf Aug 03 '14 at 04:42
  • @Prix As I said in my question, there is nothing generated in the error logs. – sharf Aug 03 '14 at 04:42
  • @KristerAndersson Actually, turns out `RewriteBase /` was all I needed, that did the trick. – sharf Aug 03 '14 at 04:45
  • @sharf - I add the comment as an short answer =) – Cyclonecode Aug 03 '14 at 04:46

2 Answers2

2

Could you try to add RewriteBase / exactly below RewriteEngine On

Dipak G.
  • 715
  • 1
  • 4
  • 18
2

Have you tried adding a RewriteBase /website/ directive after your RewriteEngine on statement?

Checkout How does rewritebase work in .htaccess for more information about how to use RewriteBase.

Community
  • 1
  • 1
Cyclonecode
  • 29,115
  • 11
  • 72
  • 93
  • +1 You did head me in the rigth direction, but Dipak's answer is technically correct for me and got in just before yours. – sharf Aug 03 '14 at 04:49