Skip to content

Blancer.com Tutorials and projects

Freelance Projects, Design and Programming Tutorials

  • Video
  • tutplus
  • Themes
  • graphics
  • code
  • Audio
  • 3d
  • Featured Projects
    • Wow Projects
  • News
    • Fiverr Clone
    • Kickstarter-clone
    • Tech news
  • Contact us
    • Report a Page!

regex route filters some /string after slug url

i want just allow string /more /next & /1 after the slug
ex :

  • https://loremipsum.com/post/hello-world/more
  • https://loremipsum.com/post/hello-world/next
  • https://loremipsum.com/post/hello-world/1

this is what i’ve try :

/([a-z0-9]+)([A-Za-z-0-9]+)(.*)[/]{0,1}(more|next|[0-9]+){0,1}[/]{0,1}

the regex is still work when i open the page like https://loremipsum.com/post/hello-world/sdfsdfsdf
note i use (.*) on the regex for allowing any character on the slug so it will automaticly redirect.

Author BlancerPosted on 2022/06/04Categories PHP

Post navigation

Previous Previous post: Session Management | How does Netflix detect the number of active users in a Netflix account?
Next Next post: Laravel: it is security issue to show expiration in signed url?

Search

Cryptocurrency Exchange Script

 Cryptocurrency Exchange Script Binance Clone

Kickstarter Clone

Kickstarter Clone

Crowdfunding software

EVM Wallet / Ethereum Multichain Wallet

groupon clone script

  • Explore our Multichain Wallet
  • Discover the Ethereum Wallet
  • Why choose Blockgum as a Geth Alternative?
  • Benefits over Moralis: The Blockgum Advantage
  • EVM Wallet Features
  • Ethereum Deposit Tools and Solutions
  • Ethereum Deposit Tracking Documentation
  • Ethereum Mobile Wallet
  • Secure BNB Wallet by Blockgum
  • Telegram Channel
  • Video
  • tutplus
  • Themes
  • graphics
  • code
  • Audio
  • 3d
  • Featured Projects
    • Wow Projects
  • News
    • Fiverr Clone
    • Kickstarter-clone
    • Tech news
  • Contact us
    • Report a Page!
Blancer.com Tutorials and projects