Jump to content

Search the Community

Showing results for tags 'apache .htaccess'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi All, we have built web site in PHP, Mysql Database and Apache web server. Site is running fine on localhost(Window) but when we try to deploy it on our test environment (ubuntu 12.04.2 platform) .htaccess is not working. I am not getting any error like 500 Internal server error or any thing, index page is loading but after that none of the pages are loading. I have enabled mod_rewrite on apache also changed AllowOverride All in /etc/apache2/sites-available/default, still its not working. Same files when i deploy on Linux shared hosting is working fine Below are the functions which are used in router class public function loader() { /*** check the route ***/ $this->getController(); /*** if the file is not there diaf ***/ if (is_readable($this->file) == false) { $this->file = $this->path.'/error404.php'; $this->controller = 'error404'; } /*** include the controller ***/ require $this->file; /*** a new controller class instance ***/ $class = $this->controller . 'Controller'; $controller = new $class($this->registry); /*** check if the action is callable ***/ if (is_callable(array($controller, $this->action)) == false) { $action = 'index'; } else { $action = $this->action; } /*echo $action."<br />"; echo "file".$this->file."--".$this->controller;*/ /*** run the action ***/ $controller->$action(); } /** * * @get the controller * * @access private * * @return void * */ private function getController() { echo "hi".$_GET['rt']; /*** get the route from the url ***/ $route = (empty($_GET['rt'])) ? '' : $_GET['rt']; if (empty($route)) { $route = 'index'; } else { /*** get the parts of the route ***/ $parts = explode('/', $route); echo "<pre>"; print_r($parts); $this->controller = $parts[0]; if(isset($parts[1])) { echo $this->action = $parts[1]; } } if (empty($this->controller)) { $this->controller = 'index'; } /*** Get action ***/ if (empty($this->action)) { $this->action = 'index'; } /*** set the file path ***/ $this->file = $this->path .'/'. $this->controller . 'Controller.php'; } below is the .htaccess file RewriteBase /var/www/pepnew/ RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] Below is the default file on /etc/apache2/sites-available <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
×
×
  • 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.