Jump to content

More internal fails due to rewrite


conker87

Recommended Posts

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 host. However, it brings up an internal server error. Can anyone see anything wrong with it? It was fine on my home server:

 

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]

Link to comment
https://forums.phpfreaks.com/topic/205638-more-internal-fails-due-to-rewrite/
Share on other sites

Well after further testing, all that was needed was to add the preceding file name to the referral, so:

# 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]

Cheers anyway guys.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.