Prettify my url with additional rewrite rules

I am trying to create clean urls by adjusting the .htaccess file

Firstly i want to string out the script type (.php) and then rewrite some of the urls. I have created the following .htaccess file

RewriteEngine on

ErrorDocument  400 /errors.php

RewriteCond %{REQUEST_FILENAME}.php -f   --> Ref A

RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^logged_in/team/(\d+)*$ /logged_in/team/?team=$1 --> Ref B

I have successfully removed the .php from the urls but cannot get the team rewrite to work.

Essentially, i have a url of

website.com/logged_in/team/?team=id
i want it to become

website.com/logged_in/team/id/ → i want it to be able to have query stings after this as (ref B)
Example of a potential page

website.com/logged_in/team/id/tasks?task=taskId
With regards to reference A. I have been looking at the following tutorial - Using htaccess Files for Pretty URLS

and noticed they included

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

I dont see a problem with the first but would the second counteract ref A? Should these be included as well?

Thanks

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.