Jump to content


RewriteBase to subdirectory as absolute path even for leading slash?

rewritebase slash absolute path htaccess

  • Please log in to reply
No replies to this topic

#1 BagoZonde


    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 22 March 2013 - 05:21 AM



For testing purposes I need to run site from /test_directory/, however every element in index.php and other places uses absolute path, e.g.:





I was trying rewriting base to /test_directory/ but unfortunately instead of reading from:




PHP is reading from:




where that file of course not exists.


I'm not familiar with RewriteBase, however I think it should work that way if I want change base dir to subdirectory.


So I need to change absolute path to every single file and every link.


Here we go with my .htaccess:



RewriteEngine On
RewriteBase /test_directory/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?var=$1 [QSA,L]


Any help will be appreciated.


A=1-A ...from Basic...
$a=1-$a ...thru PHP...
LDA $01 EOR #1 ...to 6502 ASM :}

Does it mean I'm going low-level?! ;]

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users