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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

.htaccess vs. other url then expected vs. hostfile


Go to End


1332 Views

Avatar
lerni

Community Member, 81 Posts

27 November 2008 at 2:02am

Edited: 27/11/2008 2:03am

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