Ok basically i have this page image.php wich uses a get variable called image so the url is [url]http://img.spero78.com/image.php?image=x6eafe.png[/url] for example
However I want that rewritten to
[url]http://img.spero78.com/x6eafe.png[/url]
I have tried this and various other alternatives with no luck :(
[code]
RewriteEngine On
RewriteRule ^([^_]*)$ /image.php?image=$1
[/code]
[QUOTE=Spero78;32942916]Ok basically i have this page image.php wich uses a get variable called image so the url is [url]http://img.spero78.com/image.php?image=x6eafe.png[/url] for example
However I want that rewritten to
[url]http://img.spero78.com/x6eafe.png[/url]
I have tried this and various other alternatives with no luck :(
[code]
RewriteEngine On
RewriteRule ^([^_]*)$ /image.php?image=$1
[/code][/QUOTE]
[code]
RewriteRule (.*) /image.php?image=$1
[/code]
Should be enough.
Nope ive tried that it says
[code]
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@img.spero78.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
[/code]
At the moment im using this
[code]
RewriteEngine On
RewriteRule ^([^_]*)\.html$ /image.php?image=$1 [L]
[/code]
so the URL [url]http://img.spero78.com/x6eafe.png.html[/url] works
but I don't want the .html suffix
Server error log?
Check what error.log says.
[QUOTE=runtime;32943035]Server error log?[/QUOTE]
Its just a massive line of File does not exists and its only 404.html and favicon.ico
Then try this one instead.
[CODE]
DirectoryIndex image.php
RewriteEngine on
RewriteBase /images
RewriteRule ^/([0-9a-zA-Z?-]+) image.php?img=$1 [L]
RewriteCond %{HTTP_HOST} !^\img.spero78\.com
RewriteRule ^(.*)$ http://img.spero78.com/$1 [R=permanent,L]
[/CODE]
Haven't tested it but I am completely sure that it will work. But if it doesn't, then I tried.
Whoops, forgot a line or two. My bad...
That didn't work either, this is driving me crazy it must be possible
[QUOTE=Spero78;32942965]Nope ive tried that it says
[code]
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@img.spero78.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
[/code]
At the moment im using this
[code]
RewriteEngine On
RewriteRule ^([^_]*)\.html$ /image.php?image=$1 [L]
[/code]
so the URL [url]http://img.spero78.com/x6eafe.png.html[/url] works
but I don't want the .html suffix[/QUOTE]
Just a quick question, is mod_rewrite enabled in the apache config file?
Perhaps this?
[code]RewriteEngine On
RewriteRule ^(.*) /image.php?image=$1 [L][/code]
of if that won't work something like that
[code]RewriteEngine On
RewriteRule ^(.*\..*) /image.php?image=$1.$2 [L][/code]
Sorry, you need to Log In to post a reply to this thread.