Archive

Posts Tagged ‘htaccess file’

Configure Htaccess File

November 17th, 2009 Comments off

I have a site running with Apache, Mysql, php5.

I need the htaccess file writing to re write static url’s back the their orignal dynamic url.

e.g mypage1.php?cat=something
e.g. mypage2.php?product=something

The problem is I have two pages using one variable each but the htaccess file is only processing one rule because it matches both pages.

I’m new to this and don’t know how to work round this issue without having to rewrite my php code, which I don’t want to do.

Joey

A .htaccess File

September 8th, 2009 Comments off

I need to have a .htaccess file created to redirect based on a hostname.

Please review the attached file for specifics.

Categories: PHP Tags: , ,

Url Rewriting And Captcha

July 29th, 2009 Comments off

I have a classifieds website written in PHP.
1.I want to make my webpages urls SEO friendly
2.I want to add captcha in registration form (to avoid spam)

(I had the following code in my .htaccess :

#Options +FollowSymLinks
RewriteEngine on
RewriteRule index/a/(.*)/b/(.*)/ index.php?a=$1&b=$2

But this didn’t maKe my site SEO friendly.

(My web host has the following in FAQ:
.htaccess file – the .htaccess file is used to override certain Apache rules/directives. There are directives that cannot be overridden and every attempt to do so will lead to ’500 Internal Server Error’.
Options +ExecCGI -FollowSymLinks +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch – those directives are pre-defined. If the .htaccess file you wish to use has any of those present you must comment them by placing the # symbol in-front of the directive.
- ’500 Internal Server Error’ will show up if an attempt is made to change PHP values (turn on/off) through an .htaccess file. Such lines should be commented and the desired change must be made by editing /sys/php4/php.ini or /sys/php5/php.ini depending which PHP version is set as global for the whole account – this can be checked by clicking on the PHP Settings icon in the control panel. )

Php And Cronjob

July 22nd, 2009 Comments off

Need a script that will change htaccess file.

I want to run 2 htaccess files that redirect at different times of the day (affiliate links). Do not want rewrite rule for htaccess.

So for 1 hour site will use .htaccess (file1) and next hour will use .htaccess (file2) etc. etc.

May be possible to run cronjob to a php file that will rename the htaccess files (file1) from .htacces to .htaccess-closed and then renames (file2) htaccess-closed to .htaccess

If you have any other suggestions then please advise in PMB.

The is so affiliate links will redirect to the webmaster URL affiliate ID link for 1 hour and then the members (sub-affiliate) URL for the next hour etc.etc. All redirects are in the .htaccess file 1 & 2 so no need to do any of that.

At the moment I have to change the .htaccess file manually at regular intervals.

If this is possible require rename.php script and cronjob script.

Htaccess Mod-rewrite 301 Redir

May 22nd, 2009 Comments off

This project is to produce some code that can be added to an existing .htaccess file to produce the required 301 redirection.

We have an existing cubecartv3 e-commerce store www.savoytimber.com that is using mod-rewrite to create seo friendly URLs. The site works well is very well indexed and rated by Google.

We have developed a new store to cover some of the products in the original store (specifically doors) – this uses cubecartv4 www.savoydoors.co.uk/index.php (note the index.html file redirects to the original store while under development). This site is also using mod-rewrite to produce seo friendly URLs.

The products have been copied from the old store to the new one and the product IDs are the same. To make the site live we want to be able to 301 redirect all the moved product pages from the old site to the new one (not the entire site). Two example URLs:

www.savoytimber.com/door-furniture/cat_139.html
should 301 redirect to
www.savoydoors.co.uk/door-furniture/cat_139.html

However, simply applying a 301 redirect in the htaccess file does not work correctly. See below:

Redirect 301 /door-furniture/ http://www.savoydoors.co.uk/door-furniture/
redirects to:
http://www.savoydoors.co.uk/door-furniture/index.php?_a=viewCat&catId=139

The correct page is displayed but the URL is not the SEO friendly URL that we require. This could cause problems with duplicate pages in Google.

In addition applying the above redirect to over 800 products is not ideal.

This project is to come up with the htaccess code that will allow the redirect to the seo friendly destination URL for the 800+ products.

See attached current htaccess files from both stores.
Also attached is the list of URLs to be redirected – they are all either /door-furniture or /interior-exterior-doors

NOTE: You will not have direct access to the site or the htaccess file, but I can test your solution and feedback.

Script To Create Htaccess File

April 23rd, 2009 Comments off

I need a PHP script that generates a .htaccess file that performs 301 redirections from a series of URLs on my domain to another URL, which may or may not be on the same domain.

The script would work as follows:

1. I enter one of my domains e.g.: domain.com

2. I choose whether or not to 301 redirect all URLs to another completely different URL or a related static URL on the same domain.

For a site that uses dynamic URLs, like this:

http://mydomain.com/?p=353

If I choose to redirect all dynamic URLs to a relevant static URL, the htaccess file might look something like:

Redirect permanent /?p=001 http://mydomain.com/001.php
Redirect permanent /?p=002 http://mydomain.com/002.php
Redirect permanent /?p=003 http://mydomain.com/003.php etc.

Otherwise all URLs permanently (301) redirect to the other location.

3. The script runs a “site:domain.com” in Google and Yahoo to compile a list (de-duped) of indexed URLs

4. The script then generate a .htaccess file 301 permanently redirecting all those URLs to either the other URL or the related static URL as demoed above.

Fix Htaccess File For Me

April 15th, 2009 Comments off

I need someone to Fix my htaccess file urgently
Thanks

Htaccess File

March 24th, 2009 No comments

I have a site that got hacked / infected, and in the process the .htaccess file was tampered with.

I’m not sure what it should be. All of the pages show except the index.php page, which generates an internal server error.

I have replaced the .htaccess file with one that just has a few apache handlers on it, but what is needed to make the page function is not there.

This job simply entails getting the index.php page to show again via the correct .htaccess file without breaking the rest of the website.

Needs to be done NOW.

Bear