I realize that I should know more on the Rewrite process and start to study hard yesterday to have some kind of understanding of what I’m doing here.
SITUATION: Joomla files are in a subfolder on the root.
The first thing I did (in my case is to “translate” the code g1smd give me to find my problem —> The site have a correct 301 redirect but link to images, css and other important files are broken.
g1smd advice is :
Your problem sounds like the links to your CSS and JS files are pointing to the wrong location. Use 'view source' to see the code. Be aware that it is the browser that evaluates the URL to be requested for these other resources.
The part of the code that excludes requests for real files from being rewritten might be the culprit. Where are those "real files" located? If those files are also in the subfolder then those requests SHOULD also be rewritten.
Requests for Joomla pages should be rewritten to the index file in the subfolder and requests for real files should be rewritten to their location inside the subfolder. That's two separate rules doing very similar things.
I’m trying hard here : This is what I understand/or not so far
I will put the rest later....
This is only for the first expression:
Code: Select all
# 1. Forward YourSiteName.com to www.YourSiteName.com
RewriteCond %{HTTP_HOST} !^(www\.YourSiteName\.com)?$
Plain english: If url is not http://www.YourSiteName.com process with following rule and remember it.
Question: here I don’t understand the point of making a reference point here to remember (www\.YourSiteName\.com) ?
Question: What do you need the exact match ending $ ?
Code: Select all
RewriteRule (.*) http://www.YourSiteName.com/$1 [R=301,L]
Plain English: Take any request and remember it and replace with http://www.YourSiteName.com/ and add what we remember here
Question: As we put the server request to everything, how it make the difference between request for the http://www.YourSiteName.com/ or any other sites on the server ?
Question: When we add the matched string, how come we don’t end up with double url like http://www.YourSiteName.com/http://www. ... m/anything ?