You are here:  » Rewrite rules not working

Support Forum



Rewrite rules not working

Submitted by technoarenasol on Mon, 2012-09-24 14:42 in

Hi David

I am Install script on all subdomain with rewrite rules

I am Edit config.php and .htaccess

master Site- config.php file :

$config_baseHREF = "/";
$config_useRewrite = TRUE;

Master site- htaccess file :
RewriteBase /

sub-domain - config.php file :

$config_baseHREF = "/mobile/";
$config_useRewrite = TRUE;

sub-domain site - htaccess file :
RewriteBase /mobile/

but It is not working.Thank you

Submitted by support on Mon, 2012-09-24 15:00

Hi,

The above settings would be correct for sub-directories - but sub-domains are different. A sub-domain would be accessed via a URL for example:

http://mobile.example.com/

If this is the case and you are using sub-domains and not sub-directories then in fact for each sub-domain installation you would still use:

$config_baseHREF = "/";

and

RewriteBase /

...because as far as HTTP / the web is concerned, the script is installed at the top level of your website...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-09-24 15:02

technoarenasol

yes sir i am use sub-directories like example.com/mobile , example.com/laptop

Submitted by support on Mon, 2012-09-24 15:07

Hi,

OK the above settings are correct then.

To see what is wrong, from

/mobile/

Can you hover your mouse on the browse by Merchant link and tell me the (wrong) URL that is generated?

And then do a search, and do the same for a (wrong) product URL - that should show me what is wrong...

Thanks,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-09-24 15:25

technoarenasol

Merchant link:
example.com/mobile/Homeshop18/

product URL:
example.com/mobile/product/Genuine-Works-with-Nokia-White-Leather-Flip-Case-for-Nokia-800-Lumia-CP-022NB-Imported.html

Submitted by support on Mon, 2012-09-24 15:34

Hi,

They look fine - assuming (as I think you have) you made changes to remove /category/ and /brand/ from the URLs. Can you first double check that your .htaccess file exists as

mobile/.htaccess

(i.e. ensure that it has been renamed from htaccess.txt)

If that all looks good, what actually happens when you click the links? Do you get your web servers normal 404 page for example? If you can post the installation URL (I'll remove before publishing your reply) that will help - I can normally spot what is wrong straight away looking at a site...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-09-24 15:39

technoarenasol

{link saved}

after that select mobile in dropdown menu and search nokia keyword

Submitted by support on Mon, 2012-09-24 15:49

Hi technoarenasol,

I found a file:

http://www.exampe.com/mobile/htaccess

(no "." at the beginning)

...and since this is served normally by your web server, I was able to view the contents and if you made the actual .htaccess (which I am not able to see) from this file; it wouldn't be working because RewriteBase is still

RewriteBase /

...but of course that may be nothing to do with it.

Please double check that, but if everything looks OK it would be worth checking your web servers error log if you have access to it as this normally provides information about .htaccess problems, but at the moment I'm not seeing any .htaccess effect in the /mobile/ folder at all.

Let me know if you're still not sure and I'll try and think what else to suggest to diagnose...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-09-24 16:00

technoarenasol

Sorry David..Actually i am forget to put dot on htaccess.now Its proper working...Once again really sorry for this stupid thing...

Submitted by support on Mon, 2012-09-24 16:24

No worries! I'm glad you're up and running - great looking site too!

Cheers,
David.
--
PriceTapestry.com