diff --git a/main.py b/main.py
index 71fac80c6b24d87dc3112d90b8c2ec80b33bee17..eb6a6d828024c45737d926aeb03ca62df85d1582 100644
--- a/main.py
+++ b/main.py
@@ -130,7 +130,7 @@ def home_post():
 
 @app.route('/favicon.ico') #Redirect to the static url of the favicon
 def favicon():
-    return redirect("/static/favicon.ico")
+    return redirect("/static/favicon.ico", code=301)
 
 @app.route('/<short_url>')
 def redirect_short_url(short_url):
@@ -159,7 +159,7 @@ def logout():
 
 @app.route('/user/links')#This function gives the user the posibility to see and delete his links
 def redirectOwnLinks():
-    return redirect("/user/links0")
+    return redirect("/user/links0", code=301)
 
 @app.route('/user/links<pageNumber>')#This function gives the user the posibility to see and delete his links
 def ownLinks(pageNumber):
diff --git a/newurl.py b/newurl.py
index 2034fb65fe4be7aa14d6976aded7313289a1546d..8ae819510581bf68610635a88ab934a6379b7657 100644
--- a/newurl.py
+++ b/newurl.py
@@ -17,7 +17,7 @@ def newurl(request, skipCaptcha, recaptchaPrivateKey, recaptchaPublicKey, buildd
         return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, snackbar="Please enter a url to short, before submitting this form", long_url_prefilled=request.form.get('url'), short_url_prefilled=request.form.get('short').lower(), domain_prefilled=domain_to_index[request.form.get('domain')], recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar, cookieNotice=cookieNotice) #return the user the prefilled form with an error message, because no url to short was provided
     if (request.form.get('short').replace(" ", "") == ""):
         return render_template('home.html', builddate=builddate, version=version, domain=domain_prepared, snackbar="Please enter a short name, before submitting this form", long_url_prefilled=request.form.get('url'), short_url_prefilled=request.form.get('short').lower(), domain_prefilled=domain_to_index[request.form.get('domain')], recaptchaPublicKey=recaptchaPublicKey, showDomainSelect=showDomainSelect, loginbar=loginbar, cookieNotice=cookieNotice) #return the user the prefilled form with an error message, because no short link was provided
-    shorturl = (request.form.get('domain') + "/" + request.form.get('short')).lower()
+    shorturl = (request.form.get('domain') + "/" + request.form.get('short').replace(" ", "_").replace("/", "").replace("?","")).lower()
 
     url = request.form.get('url')
     with connect('db/urls.db') as conn: #Check if another user already used the short link
diff --git a/redirectShortenURL.py b/redirectShortenURL.py
index 6d959257540e54911b21d461542f4d2ed69f9be2..ddf99da09a7d5b4443609f70ec12042443ebbeaa 100644
--- a/redirectShortenURL.py
+++ b/redirectShortenURL.py
@@ -26,6 +26,6 @@ def redirectShortenURL(request, short_url):
                 print(Exception)
                 cursor.execute('INSERT INTO ANALYTICS (SHORT_URL) VALUES ("' + host + "/" + short_url.lower() + "\")")
 
-            return redirect(url)
+            return redirect(url) #I use temp redirect here, because the owner of a link can delete it. If then the link is reused, the user will maybe redirected to the wrong page
         else:
-            abort(404)
+            abort(404) #Serve de default not found page.