Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

.htaccess vs. other url then expected vs. hostfile


Reply

828 Views

Avatar
lerni

27 November 2008 at 2:02am (Last edited: 27 November 2008 2:03am), Community Member, 80 Posts

say hi to silverstripe the first time ;-)

my hoster provids a way to access the server without a hot dns-entry like:
http://99.99.99.99/~xyz

this is nice to show the page to the customer or let them fill in contents bevor you go live. but somehow %{REQUEST_URI} does not work with .htaccess and this form (http://99.99.99.99/~xyz) of url. the server tells me servererror 500 (apache).

I konw it's possible to access the server with a hostfile-entry but this seems for some people a too big challenge. can anybody point me in the right direction to make the url rewriting work with both or at last the "http://99.99.99.99/~xyz" kinda url?

this is how .htaccess looks like:

### SILVERSTRIPE START ###
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###

thx for any help in advance
luk