.htaccess file not working as intended
Posted by: StarkHunter (47.29.5.---)
Date: August 20, 2017 01:53PM

Hi.

I am currently working on a project where I have created a Virtual Host called 'stories.com'. The htaccess file that I have created doesn't work as intended.

My htaccess file looks like this:


RewriteEngine on

RewriteBase /

RewriteRule ^help/([A-Za-z]+)$ help.php?type=$1


But when I visit it with my browser, it tells me that it cannot find 'index: type', but when I change the name of the directory with something other than the original file name, it works fine. Example:


RewriteRule ^showHelp/([A-Za-z]+)$ help.php?type=$1

The above links to 'stories.com/showHelp/about' and it the php works fine with that.

How do I fix this?

Thanks.

P.S: I have not changed or edited any of the pre-provided code of httpd.conf or any other file.



Edited 1 time(s). Last edit at 08/20/2017 01:54PM by StarkHunter.

Options: ReplyQuote
Re: .htaccess file not working as intended
Posted by: Otomatic (Moderator)
Date: August 20, 2017 02:27PM

Hi,

This question is not On Topic
This site is for people having issues getting WAMPServer running and not a general HOW DO I site for everything web related.

See Apache Documention about rewrite rules [httpd.apache.org]

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.9/7.0.23/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.9/7.0.23/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

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 »

Options: ReplyQuote


Sorry, only registered users may post in this forum.