0

Friends,
I’ve list of categories with url look like this ‘index.php?cat_id=1,2,3’
I want to rewrite my url as ‘demo-page.html’
However I want to be use here my page title in url page.
How its possible?

Waiting for reply...

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by theausum
0

Hi,

You could always create a 404 error page that does the same job. Just get the script name and do whatever with it. You will need to make sure that the browser doesn't know that its a 404 error.

Hope this help

Kieran :)

0

Take a look at the mod_rewrite module from the apache webserver, this will do the job for you.

0

Take a look at the mod_rewrite module from the apache webserver, this will do the job for you.

I have never played around with Apache before but what my idea is better if ahmedeqbal isn't using Apache.

0

I would be pretty surprised if he is not using apache, php has a tendency to run on it at most webhosting services...
I dont know about your idea, but an error page is an error page, use it properly...
mod_rewrite was made for rewriting urls so..
In case you did not know, you just have to add 3 lines to the .htacces file in your webserver directory and its done, no need to create a custom error page..

0

you can use mod_rewrite, also if you are generating the pages via a CMS or some backend/admin panel then store the slug(for ex - demo-page) in the DB and then when the user opens the page example.com/demo-page.html query the DB to find the row corresponding to "demo-page" under the slug column and fetch the data. Simple!!! :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.