mod_rewrite internal errors.

conker87

New Member
Messages
65
Reaction score
0
Points
0
I've been using the following code in my .htaccess file on my home server since I started changing my site. Now that the servers are back up, I've put all it all on my x10 hosting. However, it brings up an internal server error. Can anyone see anything wrong with it? It was fine on my home server:

Code:
RewriteEngine On

RewriteRule ^assets/ - [L]
#RewriteRule ^assets/css/.*$ [PT]
#RewriteRule ^assets/dynamic/.*$ [PT]
#RewriteRule ^assets/images/.*$ [PT]
#RewriteRule ^assets/inc/.*$ [PT]
#RewriteRule ^assets/php/.*$ [PT]
#RewriteRule ^assets/podcasts/.*$ [PT]
#RewriteRule ^assets/podcasts/will\+game\+for\+gold/.*$ [PT]
#RewriteRule ^assets/podcasts/tunnelcast/.*$ [PT]
#RewriteRule ^assets/podcasts/inessence/.*$ [PT]
#RewriteRule ^assets/twitter/.*$ [PT]

# Accounts
RewriteRule ^account/panel/([^/]*)$ /?account=panel&area=$1 [L]
RewriteRule ^account/profile/([^/]*)$ /?account=profile&id=$1 [L]
RewriteRule ^account/([^/]*)$ /?account=$1 [L]
RewriteRule ^account/([^/]*)/([^/]*)$ /?account=$1&code=$2 [L]

# Admin
RewriteRule ^admin/([^/]*)$ /?admin=$1 [L]
RewriteRule ^admin/([^/]*)/([^/]*)$ /?admin=$1&id=$2 [L]

# Pagination
RewriteRule ^p/([^/]*)$ /?p=$1 [L]

# Search
RewriteRule ^search/([^/]*)$ /?search=$1 [L]
RewriteRule ^search-type/([^/]*)$ /?search-type=$1 [L]
RewriteRule ^search-tags/([^/]*)$ /?search-tags=$1 [L]
RewriteRule ^search-category/([^/]*)$ /?search-category=$1 [L]

# Pages
RewriteRule ^([^/]*)\.html$ /?page=$1 [L]

# Content
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /?type=$1&category=$2&title=$3 [L]

# Feed
RewriteRule ^feed-type/([^/]*)\.rss$ /assets/feed/new.php?type=$1 [L]
RewriteRule ^feed-category/([^/]*)\.rss$ /assets/feed/new.php?category=$1 [L]
RewriteRule ^feed.rss$ /assets/feed/new.php [L]
 

dlukin

New Member
Messages
427
Reaction score
25
Points
0
First page of cPanel --> Error Log will contain errors if your .htaccess contains syntax errors.

Try adding

RewriteBase /

to the top of the file. (this is because of the mappings of paths in the new configuration)
 

conker87

New Member
Messages
65
Reaction score
0
Points
0
Hmm, I've added in the Base, but still no luck.

I've also checked the error log and there's nothing there other than 404 errors when looking for a 404 document (irony there).

---------- Post added at 03:41 PM ---------- Previous post was at 03:24 PM ----------

Oh God, massive fail on my part. Remember that you NEED to put in the file name of the index, the following works great:

Code:
RewriteEngine On
RewriteBase /

RewriteRule ^assets/ - [L]
#RewriteRule ^assets/css/.*$ [PT]
#RewriteRule ^assets/dynamic/.*$ [PT]
#RewriteRule ^assets/images/.*$ [PT]
#RewriteRule ^assets/inc/.*$ [PT]
#RewriteRule ^assets/php/.*$ [PT]
#RewriteRule ^assets/podcasts/.*$ [PT]
#RewriteRule ^assets/podcasts/will\+game\+for\+gold/.*$ [PT]
#RewriteRule ^assets/podcasts/tunnelcast/.*$ [PT]
#RewriteRule ^assets/podcasts/inessence/.*$ [PT]
#RewriteRule ^assets/twitter/.*$ [PT]

# Accounts
RewriteRule ^account/panel/([^/]*)$ /index.php?account=panel&area=$1 [L]
RewriteRule ^account/profile/([^/]*)$ /index.php?account=profile&id=$1 [L]
RewriteRule ^account/([^/]*)$ /index.php?account=$1 [L]
RewriteRule ^account/([^/]*)/([^/]*)$ /index.php?account=$1&code=$2 [L]

# Admin
RewriteRule ^admin/([^/]*)$ /index.php?admin=$1 [L]
RewriteRule ^admin/([^/]*)/([^/]*)$ /index.php?admin=$1&id=$2 [L]

# Pagination
RewriteRule ^p/([^/]*)$ /index.php?p=$1 [L]

# Search
RewriteRule ^search/([^/]*)$ /index.php?search=$1 [L]
RewriteRule ^search-type/([^/]*)$ /index.php?search-type=$1 [L]
RewriteRule ^search-tags/([^/]*)$ /index.php?search-tags=$1 [L]
RewriteRule ^search-category/([^/]*)$ /index.php?search-category=$1 [L]

# Pages
RewriteRule ^([^/]*)\.html$ /index.php?page=$1 [L]

# Content
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?type=$1&category=$2&title=$3 [L]

# Feed
RewriteRule ^feed-type/([^/]*)\.rss$ /assets/feed/new.php?type=$1 [L]
RewriteRule ^feed-category/([^/]*)\.rss$ /assets/feed/new.php?category=$1 [L]
RewriteRule ^feed.rss$ /assets/feed/new.php [L]
 
Last edited:
Top