FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Home  »  Htaccess  »  phpMyAdmin Shortcuts with .htaccess

by comment

phpMyAdmin Shortcuts with .htaccess

Can I access directly to database or table pages?

Yes. Out of the box, you can use URL like http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script. For server you use the server number which refers to the order of the server paragraph in config.inc.php. Table and script parts are optional.

If you want http://server/phpMyAdmin/database[/table][/script] URL, you need to do some configuration. Following lines apply only for Apache web server. First make sure, that you have enabled some features within global configuration. You need Options FollowSymLinks and AllowOverride FileInfo enabled for directory where phpMyAdmin is installed and you need mod_rewrite to be enabled. Then you just need to create following .htaccess file in root folder of phpMyAdmin installation (don’t forget to change directory name inside of it):

RewriteEngine On
RewriteBase /path_to_phpMyAdmin
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
Contents [hide]

My version

Instead of that, use this version. Just stick in the .htaccess file in the phpMyAdmin directory.

RewriteEngine On
RewriteBase /
 
RewriteRule ^index\.php$ - [L]
 
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [S=4]
 
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ /index.php?db=$1&table=$2&target=$3 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ /index.php?db=$1&target=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ /index.php?db=$1&table=$2 [R]
RewriteRule ^([a-zA-Z0-9_]+)/?$ /index.php?db=$1 [R]

See Also

Tags

February 14th, 2013

Comments Welcome

My Online Tools
WordPress Sites

My Picks

Related Articles
Newest Posts
Twitter

  • ZERO DAY - read before Trojan horse  t.co/pPMLGDJv8P 
  • Trojan Horse, a novel!  t.co/Hf8EtYaZVa 
  • The Hacker Playbook - very nice high level overview of attacks  t.co/lHwNVWi61u 
  • Clean Code - A Handbook of Agile Software Craftsmanship  t.co/hnJX0x1qIc 
  • Secrets of the JavaScript Ninja - By my absolute favorite JS hacker John Resig!  t.co/tZ42ljmcCl 
  • Hacking Exposed 7: Network Security Secrets & SolutionsMy all time favorite, basic but thorough and accurate.  t.co/jycW0RDVtZ 
  • Empty words will be no surrogate for cold resolve. Pain is nothing.  t.co/qXjpRxbjCw 
  • REVERSING: Secrets of Reverse Engineering  t.co/GaWo29lWWG 
  • NEUROMANCER  t.co/3OoknUcb5Z 
  • "The Shockwave Rider", by John Brunner (1975 hacker sci-fi)  t.co/ZW56HVUefW 
  • The Rootkit ARSENAL - Escape and Evasion in the Dark Corners of the System  t.co/1FzX6bHgsQ 
  • "We Are Anonymous - Inside the Hacker World of LulzSec, Anonymous, and the Global Cyber Insurgency" better be good!  t.co/GL0cFNiUOq 
  • THE IDEA FACTORY Bell Labs  t.co/FyVhgNwwT5 
  • The Datacenter as a Computer -- Urs Holzle  t.co/M5WIYs1OVg 

Friends and Recommends
Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two. See my article, On Hacking.
-- Richard M. Stallman






[hide]

It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

| Google+ | askapache

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service

↑ TOPMain