I came up with a rule that gives translates the following:
www.example.com/home/HomeSubPage/ to www.example.com/index.php?var=home/HomeSubPage/
Now, this works - if I echo out the var GET variable, I get home/HomeSubPage/
But when I was just testing on a simple file it worked fine for about 90% of the time, and the other 10% it got stuck and kept firefox in loading mode ( i had to restart apache to get to run again)
But it really really slows down the web site I am applying this to 100% of the time. The html isnt rendered in the browser, but if I hit view source, it shows me all the source...and its still says its loading. I have to wait about 2 minutes before the html is rendered.
In the code below, I commented out the second last line, that will translate
www.example.com/home.html to www.example.com/index.php?var=home
now THAT works flawlessly 100% of the time, so that confirms that the problem is probably in my RewriteRule and not the web site.
They are located in different places on the file system. And i need to redirect from one project to another internally, so url for site.loc is preserved.
E.g. requesting site.loc/hey/there i need apache to serve files form proj2.0.
First, i know that on the .htaccess level we cannot use RewriteRule to file-system path (for security reasons).
Okay, an Alias is a workaround. Say I add an Alias to virtual host as following:
Code: Alias /newsite /some/path/to/proj2.0
Then if i'll add the rule to proj's .htaccess:
Code: RewriteRule ^hey/there /newsite
This will work.
But, the webroot does not work:
Code: RewriteRule ^$ /newsite
Is it i'm doing something wrong or there is some quirk about the webroot?
I am using a script, on which i want to enable friendly URL, below are the instructions.
Friendly URLs Settings Apache Settings
(please add the following lines to your .htaccess file to turn on friendly URLs) <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /hcl/friendly_url.php [L] </IfModule>
I have a vds with godaddy. I uploaded my site and then uploaded .htaccess (AddHandler server-parsed .html) Then when I go to my site in browser I get this error.
Safari can’t open the page “mydomain”. The error was: “lost network connection” (NSURLErrorDomain:-1005) Please choose Report Bug to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.
The thing is, I did the exact same thing on another domain with the same htaccess file and everything works fine. SSI is enabled on both.
I'm currently having a problem with a site of mine. The problem is that trying to go to domain.com/subdirectory/ (with or without the trailing slash) gets a 404 error (even though the directory exists).
However, domain.com/subdirectory/file.php works fine.
When trying to figure out what is causing this, I remembered that someone who recently did some work on this site had to add something to the .htaccess file. Here's what they added:
I haven't done much with .htaccess, so I really have little idea what any of the above means or does (although I know it does something important).
So I guess my question is, could this bit of code be causing my problem? And, if so, how can it be corrected without messing up what this code was put there for in the first place?
RewriteCond %{QUERY_STRING} ^showtopic=([^&]+)&st=0$ RewriteRule ^forum/index.php$ [url] I get a 500 Internal Server Error when I put that in my .htaccess file. Got it from [url]
i have a mobile download site.. now i dont want users to directly download from my site.. i mean hotlinking..
I hav a referal thing in my .htaccess
RewriteCond %{HTTP_REFERER} !^[url](/)?.*$ [NC]
Now there is a flashget like software for mobiles.. i want that my users are able to download using that software but the prob is that soft doesnt sends any referal info.. so in my .htaccess i want to allow that software and i am trying this
For some reason it appends the my_profile.php to the end of the url, and it does it to any file in the same directory and just keeps going around in a loop, why would it do this?
I have just found out my server only supports .htaccess with ISAPI_Rewrite. Not quite sure how to accomplish this as in the past I just used normal .htaccess code. I just want to do a simple redirect so could anyone shed a bit of light on what I now need to pop in the file.
I'm trying to learn htaccess, but I'm having issues wrapping my head around this. I need to learn by example. Have several types of 301 permanent redirects that are needed.
Want to redirect a single page to a new page OLD - [url] NEW - [url]
Want to redirect a folder, AND any pages in it (preferably without naming EACH page), to a new folder's index OLD - [url] NEW - [url]
Want to redirect a subdomain to the primary domain OLD - [url] NEW - [url]
Want to redirect a folder, AND any pages in it, to a new subdomain OLD - [url] NEW - [url]
Using ISAPI_Rewrite 3 on 2003/IIS6, which uses htaccess commands.
Could anybody here show me what they would do in these scenarios?
I've read and read, and tried and tried, but it never seems to work out correctly. It either fails to redirect, or it redirects too much (some "open" type commands with a lot of variables will pick up the keyword -- for example, "students" -- so students.domain.com AND domain.com/students AND domain.com/program/students.html would all redirect, even though I only wanted the subdomain version, or the page version, to redirect, and not the others!).
I know how to do a redirect to a new URL using a .htaccess file if I am pointing to a different server, however both domain.com and domain.com.cn are pointing to the same server, I just am wondering what I would add into my .htaccess file to get it to redirect from domain.com.cn to domain.com?
But the subdomains also seem to be loading rather slow. Am I doing anything wrong here? Is there any way to optimise or simplify this (I have around 11 subdomains on the old domain)?
Now the software i'm using on the /forums/ is different, so i need ALL inbound links to any area of phpBB2 to redirect to /forums/ and be stripped of the "index.php=topic111.22."
All the redirects I have tried seem to leave the rest of the URL on then give a page not found.
We are porting a site from Apache to IIS6 and need to support our existing .htaccess file for Rewrites. We would like to support the .htaccess file directly as is with no redesign if possible.
Can anyone recommned a plugin that provides for this?