• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[PHP] Help excluding files from rewrite rule condition in php

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,990
Solutions
9
Reaction score
334
Location
Chile
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.php$ /characterprofile.php?name=$1

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.php$ /myaccount.php?name=$1

# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ http://relicaria.ml/$1 [R=301,L]


# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ http://relicaria.ml/$1 [R=301,L]

# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]
RewriteCond %{REQUEST_URI} !^/myaccount\.php$

im using this to remove php extension from my website and its working but i need to exclude some files from this rule like myaccount.php and some subfolders with some files like versions.php can anyone tell me how to do this? i couldnt find anything related to this or nothing that i could understand
 
Last edited:
Back
Top