Jump to content

Not Working..


N-Bomb(Nerd)

Recommended Posts

Hi, I have the following:

 

.htaccess:

Options +FollowSymlinks
RewriteEngine On

RewriteRule ^(.*)$ index.php?id=$1

 

Index.php:

<?php
echo $_GET['id'];
?>

 

Except when I do http://mywebsite.com/3f23j89 it just prints "index.php" on the page.. instead of whatever I typed after the slash..

 

When I change "^(.*)$" to "^([0-9]+)$" though.. it will display numbers.. why can't I do all digits?

Link to comment
https://forums.phpfreaks.com/topic/183385-not-working/
Share on other sites

RewriteRule ^([^/-]+)$ /index.php?id=$1

 

I use it like this

 

RewriteRule ^product-([^/-]+).html$ /products.php?colID=$1 [NC]

 

where it takes product-$var.html and changes it to products.php?collID=$var for the server and that works flawlessly, i would assume the above would work similarly.

Link to comment
https://forums.phpfreaks.com/topic/183385-not-working/#findComment-967986
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.