0

i had an htaccess for that, but the problem is... it doesn't read $_POST variables

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

Anyone know an htaccess that can remove the .php, add a trailing slash at the end and can read $_POST data. pls help

Edited by Dani: Formatting fixed

2
Contributors
2
Replies
17
Views
3 Years
Discussion Span
Last Post by vaultdweller123
0

This should work.

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

aw thanks for the reply im gonna reserve your solution. because my htaccess code works but i edited the last part

RewriteRule (.*)$ /$1/ [R=301,L]

to

RewriteRule (.*)$ /$1/ [NC,P]
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.