如何使用php创建虚拟文件夹?

如何使用php创建虚拟文件夹?,php,apache,amazon-elastic-beanstalk,php-5.4,Php,Apache,Amazon Elastic Beanstalk,Php 5.4,我将php与aws elasticbeanstalk一起使用。 我要创建接受此url的文件夹: www.example.com/481818 其中481818表示已更改的id 所以我想创建一个文件,它接受来自这个结构的每个请求www.example.com/integer。去拿身份证 我不知道如何创建这个文件 我可以使用以下url来完成此操作:www.example.com/?id=454。但是我不想要这个url结构 谢谢你把这个放到你的.htaccess文件里 <IfModule mo

我将php与aws elasticbeanstalk一起使用。 我要创建接受此url的文件夹:

www.example.com/481818
其中481818表示已更改的id

所以我想创建一个文件,它接受来自这个结构的每个请求
www.example.com/integer
。去拿身份证

我不知道如何创建这个文件

我可以使用以下url来完成此操作:
www.example.com/?id=454
。但是我不想要这个url结构


谢谢你

把这个放到你的
.htaccess
文件里

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteRule ^([0-9]+)$ index.php?id=$1 [NC,L]
</IfModule>

重新启动发动机
重写规则^([0-9]+)$index.php?id=$1[NC,L]

它可以做你想做的,我以前没有用过弹性豆茎,希望我能帮你。

把这个放到你的
.htaccess
文件中

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteRule ^([0-9]+)$ index.php?id=$1 [NC,L]
</IfModule>

重新启动发动机
重写规则^([0-9]+)$index.php?id=$1[NC,L]

它可以做你想做的,我以前没有用过弹性豆茎,希望我能帮你。

把这个放到你的
.htaccess
文件中

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteRule ^([0-9]+)$ index.php?id=$1 [NC,L]
</IfModule>

重新启动发动机
重写规则^([0-9]+)$index.php?id=$1[NC,L]

它可以做你想做的,我以前没有用过弹性豆茎,希望我能帮你。

把这个放到你的
.htaccess
文件中

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteRule ^([0-9]+)$ index.php?id=$1 [NC,L]
</IfModule>

重新启动发动机
重写规则^([0-9]+)$index.php?id=$1[NC,L]

它应该做你想做的,我以前没有使用elastic beanstalk,希望我能帮助你。

你必须将所有不存在的URL重写为脚本。在Apache上,您可以将这些规则添加到www根目录中的
.htaccess
文件中

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([0-9]+)$/index.php?id=$1[L]

您必须将所有不存在的URL重写为脚本。在Apache上,您可以将这些规则添加到www根目录中的
.htaccess
文件中

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([0-9]+)$/index.php?id=$1[L]

您必须将所有不存在的URL重写为脚本。在Apache上,您可以将这些规则添加到www根目录中的
.htaccess
文件中

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([0-9]+)$/index.php?id=$1[L]

您必须将所有不存在的URL重写为脚本。在Apache上,您可以将这些规则添加到www根目录中的
.htaccess
文件中

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^([0-9]+)$/index.php?id=$1[L]

另请参见感谢您的回复另请参见感谢您的回复另请参见感谢您的回复另请参见感谢您的回复