Jump to content

[SOLVED] Custom URL rewrite problem


Recommended Posts

I have created a custom page that lists counties from a table in my database. When a user clicks a county a list of towns associated with that county appears. The pages work great but when I try to rewrite the URLS then it still works but it adds the query to the end of the URL.

 

Here's what I want: www.mysite.com/1/merseyside.html (1 is the county id)

Here's what I get: www.mysite.com/1/merseyside.html?c=1&county=merseyside

 

It's adding the ?c=1&county=merseyside to the re-written URL.

 

Here's what I've added to the top of my .htaccess file (in the root directory of my site).

RewriteRule ^([0-9]+)/([a-zA-Z0-9_-]+)\.html$ mypage.php?&c=$1&county=$2

Is there another .htaccess file that this rule needs to go in as I can't seem to see how the category and product URLs are rewritten.

 

If anyone can help I'd be extremely grateful.

Link to comment
Share on other sites

thanks for information that you solved it, and where the problem was

as you suggested - im going to mark this thread as [solved]

 

anyway, you can also mark own topics as solved, here is an instruction:

 

 

[sOLVED] Topic
If, after posting a topic, you find a solution to your problem, please indicate it in your post and describe the solution.
Furthermore if you are the author of the topic for which a solution has been found, please edit your topic title to mark it as [sOLVED].

To mark a topic as [solved] :
- Edit the first post of your topic by clicking on the "Edit" button,
- Click on the "Use full editor" button,
- Add the "[solved]" string at the beginning of your topic title and click on the "Submit Modified Post" button.

we will be grateful if you will follow these instructions in the future :) it isn't necessary - but it's good practice. Our community will be better place then :)

 

 

thanks in advance

Link to comment
Share on other sites

×
×
  • Create New...