Home Apache HTTP Rewrite + Xampp
Reply: 1

Apache HTTP Rewrite + Xampp

Eterniuum
1#
Eterniuum Published in 2017-11-10 23:17:51Z

So i'm making a pastebin clone, or atleast a personal-version of it, and for the heck of me i can't figure out why this is not working, i'm new to .htaccess and things sort of so i don't get why this isn't working. I have a main index.php file that is where you write the paste, then it saves it to a database, after that redirects you to paste.php?uid=random unique id, however i want it to go from that to simple /paste/uid. This is the currently file i have.

RewriteEngine On

RewriteRule /paste/(.*)/$ paste.php?uid=$1
Croises
2#
Croises Reply to 2017-11-11 01:46:24Z

Use:

RewriteEngine On
RewriteRule ^paste/(.*?)/?$ paste.php?uid=$1

No slash at the beginning of the url, in htaccess RewriteRule.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.322284 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO