Hi I have the following in my .htaccess file Yet the arguments do not seem to work. My webservice just says please specify a method which means that the m parameter is not set. Any suggestions this is driving me insane
I have had issues with including the dash in the range of characters to match in the past. It may be worth a shot replacing: ([A-Za-z0-9-]+) with ([A-Za-z0-9]|-)+
Hi tried both those things and it hasn't helped. It is definitely matching but the arguments don't seen to be being passed. I was simply copying from the http://http://www.ilovejackdaniels.com/apache/mod_rewrite-cheat-sheet/ It may help if I explain exactly what I am trying to do. I am doing a project at uni creating a web service for geocoding items in RSS feeds, it is written in object orientated php and is accessed through robs.homeftp.net/georss.php . This can take a large number of arguments mostly for debugging and so when I have to demo it I can show my supervisor how it works. Currently it is accessed like the following http://robs.homeftp.net/georss.php?m=m&ch=NWS&noWords=2000&noSurnames=90000&url=http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml but I want to make this much nicer as for users of the service (once it is finished) will only need to specify the url. So any suggestions are welcome. I have just realised when writing this that the url will never match as it also contains slashes.
Original URL http://robs.homeftp.net/georss.php?m=m&ch=NWS&noWords=2000&noSurnames=90000&url=http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml How I "think" I want it http://robs.homeftp.net/georss/http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml or maybe http://robs.homeftp.net/georss-http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss.xml something like that
Only way to get that URL is if the shorter URL http://robs.homeftp.net/georss.php?...ewsonline_uk_edition/northern_ireland/rss.xml would also work, and your sites down right now. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^m/([^.]+)/ch/([^.]+)/noWords/([^.]+)/noSurnames/([^.]+)/url/([^.]+)\.html$ georss.php?m=$1&ch=$2&noWords=$3&noSurnames=$4&url=$5 [L] RewriteRule ^georss/([^.]+)\.html$ georss.php?url=$1 [L] Second line is the code if the short URL does work, first RewriteRule line if it doesn't. You'll have to have the other stuff in the URL if it doesn't.
You could just hardcode those extra values into the second rewriterule there. But if you're going to do that, it's probably just as easy to alter the script to contain default values, which are replaced by values from the URL if set.
yeah in the end I altered some scripts that were relying on the current default values and made it so I just needed to call /?url=the.url.com Thanks for your help