Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9275063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:30:04+00:00 2026-06-18T16:30:04+00:00

My server is running on php 5.3 now and I need to replace this

  • 0

My server is running on php 5.3 now and I need to replace this call to ereg:

if (ereg("/$", $pref) === FALSE) 
{
  $pref .= '/';
}

I have tried this, among other things without any success:

if (preg_match('~/$~', $pref) === FALSE)

This results in http://example.com/index.phpwww/browse
If it makes any difference, this is a CodeIgniter 1.6.1 app that I’ve inherited.

I tried this:

if (ereg("/$", $pref) === 0) 

as @PeterM suggested and now going to http://example.com takes me to http://example.com/index.php/www/browse , but that gives me the message of “The URI you submitted has disallowed characters.” Is that be a valid CodeIgniter URL? Maybe I messed something up elsewhere in the code?

I changed line 126 of codeigniter/application/config/config.php to be:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

and I still get the message.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:30:05+00:00Added an answer on June 18, 2026 at 4:30 pm

    Compare it against 0, not false. preg_match returns number of matches. It returns false only on error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two websites running on my own root server (ubuntu/nginx/php-fpm). Now I want
We have a server running PHP 4.3.9 with safe_mode ON and safe_mode_exec_dir setted to
How to send messages from php to node.js? I have a linux server running
We have an web server running cakephp that provides REST web service. Now we
For example: Content of server-a.com/test.php : echo 'hello world one'; // now I need
I have an Ubuntu 10.04 server, running PHP 5.3.2 and I have these lines
I have created a PHP script to query an LDAP server (running Microsoft Active
I have VPS and it already has apache and php sites running. Now i
I have normal sites running with php and jango on my VPS. Now i
I have a joomla project now currently running on.I need to add a separate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.