RewriteRule in .htaccess doesn't work
Answers to your questions / Web Hosting / RewriteRule in .htaccess ...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

RewriteRule in .htaccess doesn't work

by
ArkadiuszF
Created on 2021-02-03 14:04:38 (edited on 2024-09-04 14:24:49) in Web Hosting

Hi,
I've created a project on localhost and I`m trying to upload it to the ovh server.
Hovewer, the .htaccess doesn't work correctly.
Options like **_DirectoryIndex_** or **_Options -Indexes_** does work, but **_RewriteRule_** doesn't.
My .htaccess file:

SetEnv PHP_VER 7_4
SetEnv REGISTER_GLOBALS 0
RewriteEngine On
RewriteBase /

DirectoryIndex views/index.php
Options -Indexes

RewriteRule ^test views/test5.php

I also tried to do something like:
`RewriteRule ^google https://www.google.pl`
to check if it will redirect me to google, but it doesn't.

When I`m trying to go to **mypage.pl/test** or **mypage.pl/google** I receive 404 Error:
**Not Found**
**The requested URL was not found on this server.**

On localhost (apache XAMPP) it works great, but on ovh it doesn't.


Replies are currently disabled for this question.