I read a lot of Q&As here but failed to find a working solution. I want to change the URL from a flat link syntax to a “regular” query.
How do I get from this:
http://localhost/start/__developer/pages/12016652
to this:
http://localhost/start/__developer/pages/suche.php?objektnr=12016652
by either means of htaccess or PHP? Disregard the curlies please. Thanks in advance for your support!
At this point I’m trying this:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteBase /start/__developer/immo-shg-v4/pages/
RewriteRule ^([0-9]+)$ suche.php?objektnr=$1 [QSA,L,NC]
Solution:
RewriteRule ^([0-9]+)$ suche.php?objektnr=$1 [L,NC,NE,R]
The [R] flag forces a redirect.
http://httpd.apache.org/docs/2.2/rewrite/flags.html
Enable .htaccess through your httpd.conf it is not already enabled and put these lines in the .htaccess file in DOCUMENT_ROOT folder:
As per your comments below have another RewriteRule like this: