Homedir rewrite

New to mod_rewrite? This is a good place to start.

Homedir rewrite

Postby Decebal » Fri Jul 03, 2009 12:49 pm

Instead of /~user, I like to use /user. For this I wrote:
RewriteRule ^/user/(.*)$ /~user/$1 [L]

But no substitution takes place and I get a 403. What is going wrong?
Decebal
 
Posts: 3
Joined: Fri Jul 03, 2009 5:01 am

Postby richardk » Sat Jul 04, 2009 11:05 am

Where are you putting the mod_rewrite?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Decebal » Sun Jul 05, 2009 8:07 am

In http.conf.local. Which is included in http.conf with:
Include /etc/apache2/httpd.conf.local
Decebal
 
Posts: 3
Joined: Fri Jul 03, 2009 5:01 am

Postby richardk » Mon Jul 06, 2009 12:04 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^/user/(.*)$ /~user/$1 [PT,L]

Also try replacing PT with R.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 100 guests

cron