PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 22, 2022

[FIXED] How to create virtual folders using php?

 July 22, 2022     amazon-elastic-beanstalk, apache, php, php-5.4     No comments   

Issue

I am using php with aws elasticbeanstalk. I want to create folder that accept this url :

www.example.com/481818

where 481818 present an id that is changed.

so i want to create file that accept every request form this structure www.example.com/integer. and fetch the id.

i don't know how to create this file.

I can do it with this url : www.example.com/?id=4545454 . but I don't want this url structure.

thank you


Solution

Put this in you .htaccess file

<IfModule mod_rewrite.c>
    RewriteEngine on

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

It should do what you want, I didn't use elastic-beanstalk before, hopes I can help you.



Answered By - Hartman
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing