Jump to content

.htaccess not working (previously it was working)


ali_kiyani

Recommended Posts

Hi,

 

I have the following file structure

 

/.htaccess
/index.php
/displaypage.php

 

All files are on root.

 

I have following written in .htaccess file

 

Options FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^([a-z0-9-]+)$ displaypage.php?page=$1 [NC,L]

 

I have following written in displaypage.php

 

echo $_GET["page"];

 

Now when I run http://localhost/ then it shows index.php page which is correct. If I run http://localhost/something then it shows a blank page. Previously it used to display that "page" variable on screen. mod_rewrite is enabled and I am using Windows with XAMPP.

 

What am I doing wrong?

 

Thanks

Link to comment
Share on other sites

Blank php pages are usually the result of a fatal php parse error on the page.

 

Have you tested displaypage.php by browsing directly to it and do you have error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that all php detected errors will be reported and displayed?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.