-1

I need some help. This is the original link

 http://tester.local/adm/index_pub.php?ch=feondi-event

I want it to be access like this

 http://tester.local/feondi_event
rkevx21
  • 2,441
  • 5
  • 19
  • 40
  • 1
    Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](https://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained). You can't do this with mod_rewrite anyway. You are supposed to manually handle the text extraction from the rewritten url. You are obviously missing a [router](https://packagist.org/?query=router). – Mike Doe Sep 05 '18 at 06:36

3 Answers3

0

Use this line in your root .htaccess

RewriteRule ^feondi_event$ /adm/index_pub.php
JeffB
  • 191
  • 1
  • 15
0

This does not use .htaccess, but works as well:

<?php
if($_GET['ch'] == 'feondi-event') {
    header("Location: http://tester.local/feondi_event");
}
?>
h0ch5tr4355
  • 2,092
  • 4
  • 28
  • 51
0
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /adm/index_pub.php?ch=$1 [L]
</IfModule>
rkevx21
  • 2,441
  • 5
  • 19
  • 40