.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]

Options: ReplyQuote
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?

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



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

Options: ReplyQuote


Sorry, only registered users may post in this forum.