0

I have managed to get this script to work, and then I decided to insert the script into the page where it needed to go for the applications, and now it is not work, I have changed all the file path the the correct locations. But nothing.

The error I kept on getting was syntaxerror: unexpected token <

The difference I could see from the script that work and didn't was that I was using a .htaccess file for the URL rewrite, so I removed this and it worked.

So from this I would say that the .htaccess file is causing something to break the path name but I am not sure.

RewriteEngine on

RewriteRule ^([^/\.]+)/?$ index.php?lang=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&category=$3 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&category=$3&story=$4 [L]
RewriteCond %{HTTP_HOST} ^website.com$
RewriteRule ^/?$ "http\:\/\/www\.website\.com\/" [R=301,L]

Can anyone see anything that would stop this from working?

Many thanks for having a look for me

Cheers Shuka

5
  • I have tried to use the base tag, but that didn't do anything to help, which was suggested on another thread. Commented Jan 25, 2015 at 16:26
  • We need more information to be able to help you. How do you call your script, when do you get the error (on page load or on file upload),... Just more information Commented Jan 25, 2015 at 16:30
  • this error occurs on upload, it uses the Basic plus UI version. So you can add files to the queue but when you click on the upload button it comes back with this error Commented Jan 25, 2015 at 16:36
  • Try to change the last RewriteRule: RewriteRule ^/?$ http://www.website.com/ [R=301,L] Commented Jan 25, 2015 at 16:40
  • Have tried that @Croises but not done anything, still getting the error Commented Jan 25, 2015 at 17:03

1 Answer 1

1

I think your rewrite rules have already break your file upload process.

You should set these rewrite rules only work in HTTP GET method.

Add the following code to the first line of your .htaccess file.

RewriteCond %{REQUEST_METHOD} GET

It will like this:

RewriteEngine on
RewriteCond %{REQUEST_METHOD} GET
Sign up to request clarification or add additional context in comments.

3 Comments

I am sorry! I mean that you should add the "RewriteCond .." after the line of "RewriteEngine On" and before any RewriteRules.
yes I knew what you ment I have tried in both places and still nothing, thanks for the suggestion.
You should find the root cause, comment the rewrite rule line by line to test the result and figure out which one break the file upload process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.