.htaccess

How to change default version of PHP from 4 to 5?

My server have default php version of 4, so when I run some script saved as .php I have PHP 4. I want to change it, so I don't must use .php5 extension, I heared that there are something in .htacess. I want to run eyeOS on my server, but I don't want to change every line from .php to .php5 Help? ...

How to redirect a feed page using .htaccess?

I just moved my blog from Drupal to Wordpress and im currently having some problems with my old feed. The old adress for my feeds were http://bemcapaz.net/rss.xml and the current is http://bemcapaz.net/feed/, i already made the changes on feedburner and the new feed is working but the old one isnt and i dont want lose all my old readers...

How can I rewrite query parameters to path parameters in Apache?

I currently have a website that I am trying to optimize in terms of SEO. I've got the site working with URLs such as: domain.com/?app=about In my app, $_GET[app] is set to 'about', as expected. Now, I want to make it so that a URL like domain.com/about is treated as if it were domain.com/?app=about. How can I do this in an Apach...

Removing extra characters generated in re-write

I was spoon fed this htaccess file from Gumbo and I am grateful for it as I learnt a lot. However, I made some changes and reverted back and forth and managed to make some small changes again, it works 80% but there is a case when it doesn't work: If I type in http://www.example.com/view.php?t=45re it rewrites successfully but it does t...

.htaccess and $_GET rewrite

Hi, I am having an annoying issue. I have a script which uses the $_GET feature of php to get a variable from the url of the page. However, I need to know how to, first and foremost, make my page url go from http://www.example.com/dir/dir2/page.php?value=something&anothervalue=somethingelse to http://www.example.com/something/...

Folder control with .htaccess

I have a directory /public_html/myfolder/ and I want my domain www.example.com to point to /public_html/myfolder/ as my root folder. I figured that out, but problem is, my images are not showing. Here's my .htaccess file: Options -Indexes RewriteEngine on Options +FollowSymLinks RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] Rewr...

Help with htaccess RewriteRules

Hello, I am posting this question again because I didn't explain clear enough. Here are things that I need to achieve with the .htaccess file: Re-route /public_html/ to /public_html/myfolder/ Make website/index.php?q=param to website/param/ My php files are inside /public_html/myfolder/ and my image files are inside /public_html/myfol...

basic mod_rewrite question

I am trying to write a rule which says xyz.com/hotels_in_someplace will direct to xyz.com/test.php?place=someplace by using the following in my htaccess RewriteEngine On RewriteBase / RewriteRule ^hotels_in_([a-z]+)$ test.php?place=$1 [L] but its not working and I cant figure out why, I am running a wamp server as a dev. when i tr...

.htaccess file is not working on Apache Server

I have hosted my site on www.hostmoster.com, I have written .htaccess file for URL rewritting, it was working properly since last 1 year.. but today they have made some upgrade in their Apache Server.. and now my .htaccess file is not working properly. the contents of my file is RewriteEngine on RewriteRule ^$ /index.php [L] RewriteCond...

How to handle special characters in .htaccess rules?

In my .htaccess file I have defined following rule, RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA] The above rule works fine if I am browsing http://example.com/videos/t/world+news/ or http://example.com/videos/t/events/ but when I am browsing http://example.com/videos/t/business+%26+world/ (here original tag is: business & w...

Apache .htaccess hotlinking redirect

I am trying to create a redirection when someone hotlinks images in one directory on my site. If someone hotlinks an image, I want to redirect them to a corresponding image (same file name) in a different directory. If someone hotlinks: www.mydomaoin.com/PlayImages/Basic/Embedded/{ImageName.gif} I want it to redirect to: www...

.htaccess while upgrading web app

I am writing one web application using PHP/CodeIginter. Now, I want to add a .htaccess while I am upgrading the application in the server. The purpose of this .htaccess will be: - It'll allow normal operation if the user is accessing from some specific IPs, and Using a particular host name alias has a query string parameter "upgradi...

if else .htaccess/ISAPI

I would like to check a URL to see if it contains one of multiple strings, and then based on that, send it to a different URL. Am I forced to use multiple lines, one for each possibility? Or is there anyway to form an if statement? I figured that something like this should work: (string1)(string2)(string3) example.com/$1$2$3 because in...

301 redirect htaccess subfolder problem

I am having a problem getting some of my 301 redirects to work correctly in htaccess. The problem is the subfolders on the new link do not line up: Redirect 301 /properties/available-properties/filename.html http://www.domain.com/index.php/properties/available/new-filename the problem is that it returns the path of: www.domain.com/ind...

Solved -> Just Installed ISAPI 3 -> httpd.ini / .htaccess not working!

trying a simple 1 to 1 redirect. I've tried this the ISAPI way and the Apache way, nothing seems to work. While I know this is very vague, I am very unfamiliar with this system. What steps would you recommend to troubleshoot? Problem Solved. For further discussion -> troubleshooting techniques ...

How can I append HTTP_REFERER to query string using htaccess?

In my .htaccess file I have a set of rules as follows: RewriteRule ^dir/page1$ /bleh/docs/?id=12 [L,QSA] RewriteRule ^dir/page2$ /bleh/docs/?id=13 [L,QSA] RewriteRule ^dir/page3$ /bleh/docs/?id=14 [L,QSA] Sometimes one of these rules may be accessed via a redirect from another site (referer). I would like to be able to append the refe...

htaccess subdomain redirct with last url parameter

I want to write a .htaccess file for redirecting my subdomains and URL's last variable to a new location. Here is what I want to do: http(s)://abc.example.com/books I want my internal URL to be like: http://example.com/?name=abc&type=books I have already gotten the subdomain redirect to work but I am not able to do subdom...

How to allow wordpress site to display standalone HTML pages?

this is my WP htaccess RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] i want wordpress' htaccess to stay out of the way when the link is to a standalone .html|.htm file inside the /ag directory. RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_...

How to append a path to PHP's include_path in .htaccess

Currently on my site I'm using statements like: include 'head.php'; include '../head.php'; include '../../head.php'; depending on how many nested folders deep I am. I'm sure there is a better way to do this. I'm convinced .htaccess is the solution, but I'm not sure how to go about implementing it. If I insert: php_value include_path...

PHP and htaccess redirection: Rewriting yoursite.com/user.php?username=xyz to yoursite.com/xyz

Hi, let's say I want to use .htaccess to rewrite the following. Rewriting /user.php?username=xyz to /xyz. I would use: RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1 The problem is once this is done, how do I access the username in my other links? so /mike/d...