xiaolun
xiaolun

Reputation: 23

how to transfer dot in mod_rewrite?

I want to design a RewriteRule for the URL beta2.0/user/11 to beta2.0/user.php?11 and my .htaccess rule is

RewriteRule ^beta2\.0/user/([0-9]*)$ /beta2.0/user.php?user_id=$1 [L]

however the RewriteRule not work, is there any problem in my Rule? And the problem is in the dot in the original url

Upvotes: 0

Views: 28

Answers (1)

olegsv
olegsv

Reputation: 1462

I assume your .htaccess is located in the same level as beta2.0 directory.

root
   +---.htaccess
   +--- beta2.0/
              +---user.php

Place the following into .htaccess

RewriteEngine On
RewriteBase /
RewriteRule beta2\.0/user/([0-9]+) "/beta2.0/user.php?user_id=$1" 

Upvotes: 1

Related Questions