Need help with .htaccess file (remove parameter)

Ecodor

Senior Member
Joined
Nov 5, 2017
Messages
896
Reaction score
232
I need some push with this, i have website that url structure looks like this
https://domain.com/folder/index.php?name=asdasdasdHow do i remove this part of the url "index.php?name=" so it looks like this
https://domain.com/folder/asdasdasd
The passed value (asdasdasd) sometimes also contain these symbols ( . ) or ( - ) or ( _ ) so it will look like this (asd.asdasd) or (asdasd_asd) you get my point :D

Thank you very much if anyone can help :)
 
Probably something like this:

Code:
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteRule ^/folder/(.*) /folder/index.php?name=$1
 
@TomTheCat Thank you for your reply, although this doesn't solves the problem. When i visit the URL it gives me 404 Page not Found

This is how my .htaccess file looks ATM
Code:
RewriteEngine On
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule ^/folder-name/(.*) /folder-name/index.php?name=$1

I am so sorry, in the post i opened the thread i didn't mention that the folder have this symbol '-'. Maybe its because of that ?
So basically the URL structure needs to look like this
https://domain.com/folder-name/asdasdasd
 
I changed the folder into one word but still cannot figure it out..
 
I've been trying many different ways to solve this problem but seems i cannot make it 2 days :D
 
Anyone who can answer it ? :anyway:
 
Back
Top