Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RewriteRule makes an 500 Internal Server Error

Featured Replies

hey @ all =)

its mi first post but untyl today a had no problems with the unifomserver,

nice work =) but there i have one question:

why does a a RewriteRule make an 500 Internal Server Error ?

my code:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3&do=$4

RewriteRule ^contact$ /index.php?ids=contact

it happens also on a fresh uniserver installation as on other OSes to, my OS w2k3, but it also happens on XP.

do someone have some infos how i can realize that the code i posted would work?

an my real webserver it does work, only localy on uniform it wants :D

 

thx

Stefano

Not sure what you are trying to do with the code however a 500 error indicates a server configuration problem.

 

Check the server error log (*\Uniform Server\udrive\usr\local\apache2\logs\error.log) to see what the problem is.

 

I have little experience with RewriteRule is the first minus valid [-0-9a-z] thought it specified a range hence something should come before it!

 

Are you sure this is a valid construct *+ to me it looks as if they may conflict.

 

You state on your real server it works, would this be Apache 1.3!

 

I think check the error log first, should point you in the right direction. :D

 

All the best

Ric

Try:

 

RewriteEngine On
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3&do=$4

RewriteRule ^contact$ /index.php?ids=contact

 

or

 

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3
RewriteRule ^([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)/([-0-9a-z]*+)$ /index.php?ids=$1&section=$2&page=$3&do=$4

RewriteRule ^contact$ /index.php?ids=contact

  • Author

hey =)

thanks for the replys =)

this is form the error log:

"W:/www/.htaccess: RewriteRule: cannot compile regular expression '^([0-9a-z]*+)/([0-9a-z]*+)$' "

now ive changed this ([-0-9a-z]*+) to this ([0-9a-z])

now there is no error, but i cant use now the function i made before.

this script should work like this:

httq://localhost/main-cat/section1/page2/edit/

and interprets i to:

/index.php?ids=$1&section=$2&page=$3&do=$4

 

i want to eliminate urls like this httq://localhost/?ids=main-category&section=1&do=edit

to make mo user/crawler friendly urls

 

here a Demo

and there is nothing changed its the code ive posted before

hosters apache version is:

Apache/2.0.54 (Debian GNU/Linux) PHP/5.2.4-0+tld0 with Suhosin-Patch mod_ssl/2.0.54 OpenSSL/0.9.7e

 

@olajideolaolorun: ive tried what you have posted but it doesnot work.

 

i am noob in regular expression, so i dont now how to realize this so that it can work localy =(

maybe some idea how to made user friendly urls for the UFS?

 

thx Stefano

 

ps: sorry for my bad english

I think the only problem is with *+ in the original code use + only try this:

 

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([-0-9a-z]+)/([-0-9a-z]+)$ /index.php?ids=$1&section=$2
RewriteRule ^([-0-9a-z]+)/([-0-9a-z]+)/([-0-9a-z]+)$ /index.php?ids=$1&section=$2&page=$3
RewriteRule ^([-0-9a-z]+)/([-0-9a-z]+)/([-0-9a-z]+)/([-0-9a-z]+)$ /index.php?ids=$1&section=$2&page=$3&do=$4

RewriteRule ^contact$ /index.php?ids=contact

 

All the best

Ric :D

  • Author

@olajideolaolorun: yes i tried, nothing changed.

@Ric : there it is =) now it works! great!

 

thx to all =) nice evening =)

 

Stefano

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.