Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.