.htaccess mod_rewrite does not redirect url that contains "index" but redirect other pages in wamp
Posted by: emman (41.189.173.---)
Date: September 06, 2017 04:44AM

.htaccess mod_rewrite does not redirect url that contains "index" but redirect other pages


Example

when you navigate to "[localhost]; The request_uri is empty.

But when you navigate to [localhost] or any other page, the page displays the correct view.

Please note mod_rewrite in enable in wamp server and this .htaccess file works perfectly when running xampp.

Here is my .htacces file
RewriteEngine on
RewriteBase /projectname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request_uri=$1 [NC,L,QSA,B]

Re: .htaccess mod_rewrite does not redirect url that contains "index" but redirect other pages in wamp
Posted by: Otomatic (Moderator)
Date: September 06, 2017 09:34AM

Hi,

You should use VirtualHost. See The need for Virtual Host

See Apache documentation [httpd.apache.org]

There may be a need to add, at the beginning of the .htaccess file

Options +FollowSymLinks -MultiViews

> this .htaccess file works perfectly when running xampp.
That does not mean anything.
Is it the same Apache versions?
Are the same modules loaded?
Is it the same configurations, httpd.conf for example?
In conclusion, is everything strictly identical in both environments?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 2 time(s). Last edit at 09/06/2017 11:04AM by Otomatic.

Sorry, only registered users may post in this forum.