need help to enable .htaccess in vps

Status
Not open for further replies.
3 comments
What is it your trying to achieve?

URL rewriting is usually used to convert data inputs into a clean url eg
mysite.com/showproduct.php?id=1391
to
mysite.com/showproduct/1391

If that's all you want it can be done by simply changing the .htaccess file with the FilesMatch tag. In the example above add:


<FilesMatch "^showproduct$">
ForceType application/x-httpd-php
</FilesMatch>

then in your code put

$expl = explode("/",$_SERVER["REQUEST_URI"]);
$id = $expl[count($expl)-1];

All this should be enabled by defult!

If your wondering why any .htaccess file seems to disappear once you upload it, that's because any file that begins with . in linux is hidden. Its there, just your ftp client cant see it.
 
If he uses FileZilla it's usually visible automatically.

If he uses another, then there are ways of forcing to see . files by adding -a in a listing properties; or just access cPanel, File Manager 'Enable . files' and there you go.
 
Login into WHM - Click on EasyApache Update - Rebuild Apache, but don't forget to check "Mod Rewrite", Apache will be rebuild including MR.
 
Status
Not open for further replies.
Back
Top