.htaccess - AMRQ (Another mod_rewrite rule quest) -
Reference here: I know, to modify the URL inside my php code, to get into the address bar Instead of
http: //website.tdn/somepath/news-246-some-title.html
:
http: //website.tdn/somepath/lireNews.php? Idnews = 246 and titre = some-title
(I mean both URLs are working but lireNews.php? Blah will have to restart news - ### - title .html) My HTACS file here:
option + rewrite engine on follow-up clerks ^ lirnewsfip? IDNews = ([0- 9] +) In fact, this code is not working at all, thanks to the news-246- . A few header APIs give me a 404 error and lireNews.php? Idnews = 246 and titre = some-titles, giving me a webpage without redirection.
With your comment in mind, you can put this code in your htaccess (i n some paths
folders)
RewriteBase / somepath / RewriteCond% {THE_REQUEST} /lireNews\.php\?idnews= ([0-9] +) on RewriteEngine ; Titre = ([^ \ s] +) [NC] rewritable news-% 1-% 2.html? [R = 301, L] RER RT. ^ ^ - ([0- 9] +) - (. +) \ Html $ lireNews.php? Idnews = $ 1 and Titre = $ 2 [L]
If you move it to the subdomain folder to root, you just have to do it RewriteBase / somepath /
by RewriteBase /
Comments
Post a Comment