Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 837 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Unexpected token '>'" line 1 after htaccess rewrite (Breaks css & images)

#1
Basically, what I've been aiming at doing is to fix broken links. Old links might point to `http://www.example.com/work/funkystuff`, and I'm redirecting them to go to `http://www.example.com/en/work/funkystuff`.

So here are the symptoms of this horrible disease:

1. Images, Css & Javascript breaks. The console tells me "`Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/en/".`" for each type.

2. I get the weird error about "`Uncaught SyntaxError: Unexpected token <`" on line one of my `index.php` files, where my doctype is. This leads me to think that it's not even interpreting my .php document as a .php document...

From what I've gathered from my Google sessions, this shouldn't be happening. My links are absolute (echoed out by php), and I have the RewriteCond to only redirect non-existing files & directories (line 4 & 5).

So yeah, this is what my .htaccess looks like.

# enable awesome urls. i.e.:
#

[To see links please register here]

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links will break.
#
# If your homepage is

[To see links please register here]

# Set the RewriteBase to:
#
# RewriteBase /mysite
#
RewriteBase /

# Redirect key areas of the site before localisation.
RewriteRule ^work/(.*)$ /en/work/$1 [NC,R=301,L]
RewriteRule ^news/(.*)$ /en/news/$1 [NC,R=301,L]
RewriteRule ^about/(.*)$ /en/about/$1 [NC,R=301,L]
RewriteRule ^careers/(.*)$ /en/careers/$1 [NC,R=301,L]
RewriteRule ^contact/(.*)$ /en/contact/$1 [NC,R=301,L]
RewriteRule ^update-twitter/(.*)$ /en/update-twitter/$1 [NC,R=301,L]

# redirect everything to index.php
RewriteRule ^(.*) index.php [L]

I hope someone knows what this might be, because I'm confused as hell.

**EDIT**: I feel that I should add some more information.

We're using a CMS called Kirby and are now starting to move over to a multi-language version of the site. Kirby can do this for us simply, by auto-detecting browser language and redirecting users from domain to domain/language.

The thing is that we're complicating things by using redirects. The language part of the URL isn't a real subdirectory, but rather a name.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through