Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: .htaccess help

  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess help

    Hello All,

    I am working on .htaccess file having code as below,

    RewriteEngine On
    RewriteRule ^csp([0-9]+)$ index.php?id=$1
    RewriteRule ^csa([0-9]+)$ index.php?id=$1
    RewriteRule ^ID([0-9]+)$ index1.php?id=$1

    The site was working with same file on other server. When we shifted the server, the problem is in redirection of files.

    If I use www.mydomain.com/cd/ID1234567895/ then it works, but if I remove / from the end of url then file is not redirected to index1.php.

    Do anyone have knowledge about the solution? I dont know why this problem arises. Is there any setting required for .htaccess depending on server?

    Please reply asap.
    Thanks in advance.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I had a similar type problem, but not identical ...

    This is the only thing I can think of where I had to
    add for one server but not another (line in blue):

    Options +Indexes +FollowSymlinks
    RewriteEngine On
    RewriteRule ^csp([0-9]+)$ index.php?id=$1
    RewriteRule ^csa([0-9]+)$ index.php?id=$1
    RewriteRule ^ID([0-9]+)$ index1.php?id=$1

    It's just a "shot in the dark", but it's worth trying.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts
    mlseim:

    How does this actually work and if you could, can you run through how your line in blue is interpreted.

    D.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Daemonkin ...

    I don't know how it works ...
    I just know it fixed a similar problem I had with the RewriteRules
    not following my directories through the site. It was something
    I thought he could try really quick and see if it works for him too.

    I'm really not an expert at all with .htaccess

  • #5
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks for reply.
    The solution that u have provided is also not working with my .htaccess file.
    I am still facing the same problem


    Thanks

  • #6
    Regular Coder
    Join Date
    Feb 2008
    Location
    Australia baby!
    Posts
    143
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by abhini268 View Post
    Hello All,

    I am working on .htaccess file having code as below,

    RewriteEngine On
    RewriteRule ^csp([0-9]+)$ index.php?id=$1
    RewriteRule ^csa([0-9]+)$ index.php?id=$1
    RewriteRule ^ID([0-9]+)$ index1.php?id=$1

    The site was working with same file on other server. When we shifted the server, the problem is in redirection of files.

    If I use www.mydomain.com/cd/ID1234567895/ then it works, but if I remove / from the end of url then file is not redirected to index1.php.

    Do anyone have knowledge about the solution? I dont know why this problem arises. Is there any setting required for .htaccess depending on server?

    Please reply asap.
    Thanks in advance.
    OK so the first rule for example rewrites this:
    yourwebsite.com/csp11
    to this:
    yourwebsite.com/index.php?id=11

    the second rule is the same, but rewriting csa. The third rule is rewriting to index1.php?id=11. Now you are saying when you goto yourwebsite.com/cd/ID98743987432/. This is not rewritten by this .htaccess at all as far as I can see man, you have no line referring to the cd/ directory. Can we get a list of what exactly wants to be rewritten to what?
    Last edited by outseeker; 02-19-2008 at 07:51 AM.
    outseeker - http://outer.reaches.dyndns.org/index.php
    I hope this helped someone. Due to this forums lame rep system penalising me for nothing, and admins inability to do anything about it, I'm sorry to say I will no longer be online here. Pride is important. Good Luck All.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •