I am trying to remove the url.com/php/ (/php/) part of my url and have tried to use htaccess with the following lines
RewriteCond %{REQUEST_URI} !^/php RewriteRule (.*) /php/$1 [QSA,L] but received this error on server:
The requested URL /php/index.php was not found on this server.
It is actually adding /php/ after my url.com address in every scenario. I have tried a plethora of other threads all with different results but this one actually removes /php/ from the url, just in this case is assuming that /php/ belongs there every time. Any ideas on how to fix this?
Thanks
Edit: Now that I think about it, I'm actually trying to rewrite the entire folder tree so that only the filename and url show up.
So url.com/php/ra/file.php?id=1 shows up as url.com/file.php?id=1
My entire htaccess file to eliminate confusion:
# Use PHP5.4 Single php.ini as default AddHandler application/x-httpd-php54s .php Options -Indexes +FollowSymLinks -MultiViews RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://urlreplaced.com/$1 [R,L] RewriteCond %{REQUEST_URI} !^/php RewriteRule (.*) /php/$1 [QSA,L] edit2: Apologies for the confusion.
my site url is : https://www.url.com
currently /php/ is next level down and within that is /ea/ , /hbu/ , /hc/, /ra/, /st/, and /tut/
php contains a lot of files but all ending in .php and accepting GET vars
as well as each directory with probably 100 .php files in each. If I understand what I've read so far about this issue correctly doesn't $1 after the subdirectory cover what files are inside of it?
I need any and all files past the /php/ directory to show up in the URL as url.com/example.php?var=x no matter what subdirectory is past that.
So whether example.php exists in /php/ra or /php/hbu or just plain /php it still amounts to url.com/example.php
Thanks for your help