How to remove index.php? from url

dani26336

New member
May 3, 2021
16
4
3
Hello everyone as the title says i want to remove index.url? from my url i tried this in htaccess but it doesnt work still

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule ^/folder/(.*) /folder/index.php?name=$1
 

counselme

Member
Feb 28, 2020
60
9
8
Hello everyone as the title says i want to remove index.url? from my url i tried this in htaccess but it doesnt work still

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule ^/folder/(.*) /folder/index.php?name=$1
Use this:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php </IfModule>
 

Dbrown.sts

New member
Jun 24, 2022
8
3
3
If your website is on wordpress go settings>>permalinks>>custom structure >> category + postname
it will resolve the issue
 

dani26336

New member
May 3, 2021
16
4
3
Use this:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php </IfModule>
The code didnt work, but i also forgot to mention that
my website has url structure that looks like this
How do i remove this part of the url "index.php?name=" so it looks like this

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 :)
 

counselme

Member
Feb 28, 2020
60
9
8
The code didnt work, but i also forgot to mention that
my website has url structure that looks like this
How do i remove this part of the url "index.php?name=" so it looks like this

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 :)
Try this. Don't know if this will work as I have not tried it but it should work:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteRule ^folder/([-\w]+) folder/index.php?name=$1 [NC,L] </IfModule>
 

Forum statistics

Threads
69,206
Messages
908,333
Members
236,836
Latest member
torinouq

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu