rewrite url parameters with htaccess?

potatis

New Member
Credits
0
Hello,

been trying to find a htaccess forum on the internet but havent found any so i hope that maybe you guys could help me.

at the moment my url look like this:
example.com?para1=15&para2=today

sometimes only one of the parameters are set ie:
example.com?para2=today

I want to rewrite the url to look like
example.com/15/today
example.com/today

the file is not always the same file so i guess {SCRIPT_FILENAME} or something has to be used.

I do at the moment hide .php extension. I dont know if you need to have that information or not:


RewriteEngine on
RewriteBase /

# Remove php extension
rewritecond %{SCRIPT_FILENAME}.php -f
rewriterule [^/]$ %{REQUEST_URI}.php [QSA,L]
rewriterule ^(.*)/$ $1 [R=301,L]


i tried doing this but it didnt make it work
RewriteRule ^([^/]+)/([^/]+)$ test.php?t=$a
 
Last edited:


721c63e946

New Member
Credits
130
This is the normal way many CMS work. It's certainly not cloaking. It's a normal redirect from ?id=12345 to /pretty-url/ - nothing cloaked about it.






Kodi nox
 
Last edited:


Members online


Top