So I have script that works on some server and not on others. It doesnt work on mine so I am thinking this has to do with the coding I tried to enable magic quotes using this in htaccess <IfModule mod_php5.c> php_flag magic_quotes_gpc on php_flag magic_quotes_runtime on </IfModule> <IfModule mod_php4.c> php_flag magic_quotes_gpc on php_flag magic_quotes_runtime on </IfModule> Code (markup): didnt help what is happening is when you input a single word tag or no tag it works fine. BUT if you but in multiple words without a _ or - it will generate a url but the url is a 404. So I need someone to A) make it so it returns a error saying only _ and - can be used no spaces or other characters for tags only. OR B) create a default url like it does when no tag is used and ignoring the tags all together if a space or other character is used except for the _ and - you can view the site in question HERE and try it with a single word tag no tag and multiple tags with spaces to see what I mean. This is a free script. I will give the person access to my cpanel so they can do the repairs. Give me some quotes and this is payable by paypal
The form validation in your PHP isn't very thorough. It is possible to submit the form successfully (clicking on "Generate") with spaces in the "Tag it" field. The redirect however clearly doesn't work with spaces in the tag. This should be a simple fix in your index.php code. Post it or PM me and I can take a look. A question you might want to ask yourself though is whether allowing tagging like this is a good idea at all. Allowing anyone to create URLs of the form "http://urluda.com/anything" to me seems instinctively like a bad idea. I dread to think what people might put and where they might redirect it.
Since this was not clear and I don't know how to explain this any better I have just removed the tagging option until I can find someone that understands what I am saying and wanting to achieve.
I understand what it is you want to achieve. Either of your A or B options would require an edit to your index.php file. I'm sure it would be a simple fix if I could see the code. There is a third option which would be to continue to allow the spaces in the tag but edit your .htaccess file so that the redirect works. I'm sure that would be a simple fix too, if I could see the contents of the file.
current htaccess RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^urluda\.com$ RewriteRule (.*) http://urluda.com/$1 [R=301,L] RewriteRule ^([0-9]+)[/]*$ index.php?action=redirect&id=$1 RewriteRule ^([a-z0-9-]+)[/]*$ index.php?action=redirect&tag=$1 Code (markup): I think it will be fine as is though.
This should do it: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^urluda\.com$ RewriteRule (.*) http://urluda.com/$1 [R=301,L] RewriteRule ^([0-9]+)[/]*$ index.php?action=redirect&id=$1 RewriteRule ^([-\ a-z0-9_]+)[/]*$ index.php?action=redirect&tag=$1 Code (markup): Though as you say it is probably fine as it is.