Strange mod_rewrite & .htaccess behavior

mod_rewrite not working after folder move

Page 1 of 1

0 Replies - 573 Views - Last Post: 13 June 2009 - 01:46 AM

#1 terran261  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-June 09

Strange mod_rewrite & .htaccess behavior

Posted 13 June 2009 - 01:46 AM

Hello all, I have run across a problem that has stumped me. My .htaccess file looks like this:
RewriteEngine on
RewriteRule ^user/([^/\.+)/?$ user.php?dname=$1



What is throwing me is that this was working entirely fine, until I moved folders. I had been working in a different folder while testing, then moved my user.php to the root folder and this stopped working. I know for sure .htaccess is being parsed because if I add rules to .htaccess to force the use of www.

RewriteEngine on
RewriteRule ^user/([^/\.+)/?$ user.php?dname=$1

RewriteCond %{HTTP_HOST} !^www\.walkingtextbook\.com [NC]
RewriteRule ^(.*)$ http://www.walkingtextbook.com/$1 [R=301]



That seems to function properly.

The relevant URLs are:
http://www.walkingte...dname=terran261
vs.
http://www.walkingte.../user/terran261

With the ?dname= set you'll notice I have the
$_GET['dname'] variable echoed at the very top.

Again, let me reiterate, this had been working fine, but stopped working unexpectedly after moving up one level to the root directory.

Any thoughts? Thank you very much.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1