1

I am trying to create a loose page on my oxwall website.

The standard htaccess of oxwall is like this:

Options +FollowSymLinks
RewriteEngine On

AddEncoding gzip .gz
AddEncoding gzip .gzip
<FilesMatch "\.(js.gz|js.gzip)$">
  ForceType text/javascript
</FilesMatch>
<FilesMatch "\.(css.gz|css.gzip)$">
  ForceType text/css
</FilesMatch>


RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} !/captcha\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

Now i have a file, file.php, placed in the root of my website. I want to be able to access this file like this: http://www.website.com/test

I have been able to exclude the file from the rewriterule with this:

RewriteCond %{REQUEST_URI} !/test.php

So now i could access my file like this: http://www.website.com/test.php

Or i've been able to remove the extension like this:

RewriteRule ^test test.php

Now if i do this, the real index wont load properly anymore.

Does anyone know what i'm doing wrong. Or do you have a different solution i can use?

Thanks, Robin

Robin
  • 164
  • 14
  • What do you mean by `the real index wont load properly anymore`? – anubhava Jul 27 '16 at 16:52
  • Well, `test` (or `invite-friends`) is still matched for `index.php`, but that may not need to matter if you placed your rule before the `index.php` rule. You did not treat the second argument of your condition as a regex, which means that `.` matches a lot more than a literal dot. That too would not matter. – Sumurai8 Jul 27 '16 at 17:08
  • With `the real index wont load properly anymore` im not sure whats wrong, it seems to load all the styles and stuff properly but it looks like most of the style is gone. I did place the rules before my final rule `RewriteRule (.*) index.php` – Robin Jul 28 '16 at 06:39

1 Answers1

0

Solved by creating a folder called test and adding index.php in this folder

htaccess code used is RewriteCond %{REQUEST_URI} !/test/ before the final rule So now my url to this page is http://www.website.com/test

One simple solution for this hours of waste

Cheers

Robin
  • 164
  • 14