[TYPO3-english] enable a "Url rewrite" rule with htaccess

RAKIBI Anass anass.rakibi at gmail.com
Thu Dec 18 16:16:12 CET 2014


Hey , I have a serious problem enabling a url rewrite rule using the htaccess file , what I'm trying to do is when ever the user entered 
 
a url that looks like : mysite.com/directory1/directory2/directory3 , i want to call a directory3.html that exists inside the directory2 . 

mysite.com/directory1/directory2  ==> mysite.com/directory1/directory2.html 

mysite.com/directory1  ==> mysite.com/directory1.html 

and show the extension .html in the url bar .

Now I did write this  rule that does this on my local machine but on a normal website ( not a typo3) :
 
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/RestAPI/$1\.html -f [NC] 
RewriteRule ^(.+?)/?$ /RestAPI/$1.html [L,R]

with RestAPI beeing here the Folder that contains the .htaccess file and to be found inside Htdocs (xampp) .
Now when I copy this in the .htaccess file of my typo3 it does not work . I should mention that this .htacess file of (typo3) already contains 
some other rewrite rules , do you think this may affect the new one I added ? 
else , how can I make it work ? 


More information about the TYPO3-english mailing list