2016-12-01 37 views
1

URL网址:http://localhost/dashboard/ {} random_string的index.php如何用随机htaccess的

.htaccess文件

RewriteEngine on 
# Options +FollowSymlinks 
RewriteRule ^([^.?]+)$ %{REQUEST_URI}.php [L] 
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^[A-Za-z0-9]{4}/(.*?)$ /dashboard/$1 [L,DPI] 

,但它仍然404NF,u能帮助我吗?

+0

因此,最终,你想要什么它太改写? –

回答

0

我假设你想http://localhost/dashboard/{random_string}/index.php将被处理为http://localhost/dashboard/index.php?id={random_string}

RewriteEngine on 
RewriteBase "/" 
RewriteRule "^dashboard/([^/]+)/index.php$" "dashboard/index.php?id=$1" [L]