What's wrong with my .htaccess file?

+1 Jesse Cox · March 7, 2015
I've written a wiki and would like for my URLs to be in this format. url/page/{pagename}. Xampp isn't allowing all of my .htaccess file to work though (only parts).


RewriteEngine On

DirectoryIndex index.cgi

Options -Indexes

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+) $1.cgi [NC]

RewriteRule ^/page/([a-zA-z0-9]+)$ index.cgi?page=$1 [NC, L]


Ths last line isn't working at all and I have no idea why. Can someone help? Thanks.

Post a Reply

Replies

Oldest  Newest  Rating
+1 Alan Johnson · March 15, 2015
In your .htacess file:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?page/([a-zA-z0-9-_]+)/?$ index.cgi?page=$1 [NC,L,QSA]
RewriteRule ^/?([^\.*]+) $1.cgi[NC,L,QSA]
  • 1

PHP

107,269 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators