473,385 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

mod_rewrite doesn't. Want to change the URL Address.

12
Hai friends,


I want's to change the current url mode of my project.

At present the url looks like this

http://vishal/nilesh/URL/hotel.php?id=1&name=Pakwan

I want to change it in to below form
http://vishal/nilesh/URL/hotel.php/1/Pakwan

I have tried by creating .htaccess file in URL folder and writing
below code in it but it shows no change in address.

RewriteEngine On
RewriteRule ^URL/([0-9]+) /hotel.php?id=$1

I have tried this also
#RewriteRule /URL/(.*)$ /URL/hotel.php?id=$1


please help me to do this.
Jun 8 '07 #1
6 2487
Purple
404 Expert 256MB
Hi,

Could I ask why you are trying to do this ?

Purple
Jun 8 '07 #2
epots9
1,351 Expert 1GB
try this tutorial:
http://www.yourhtmlsource.com/sitema...rewriting.html

its doing what your doing.
Jun 8 '07 #3
pbmods
5,821 Expert 4TB
Changed thread title for better search traffic.

mod_rewrite is a server-side plugin, so it doesn't change anything in the User's browser. Instead, it "rewrites" the query so that the server gets a different resource than what the User typed.
Jun 8 '07 #4
Motoma
3,237 Expert 2GB
try this tutorial:
http://www.yourhtmlsource.com/sitema...rewriting.html

its doing what your doing.
Great link epots9, thanks!
Jun 8 '07 #5
nil81
12
hi,

I have tried this code in my .htaccess file to change the url address from

http://vishal/nilesh/URL/hotel.php?id=1&name=Pakwan

to

http://vishal/nilesh/URL/hotel.php/1/Pakwan

.htaccess file
____________
RewriteEngine On
RewriteRule ^hotel/(.*)(.*).php /nilesh/u/hotel.php?id=1&name=Pakwan

After writing this code when I have run my site It show no change nor it have given any error.

can u tell me how can v know that our .htaccess file is enable.

or if there is any other error in my code.
Jun 11 '07 #6
Motoma
3,237 Expert 2GB
hi,

I have tried this code in my .htaccess file to change the url address from

http://vishal/nilesh/URL/hotel.php?id=1&name=Pakwan

to

http://vishal/nilesh/URL/hotel.php/1/Pakwan

.htaccess file
____________
RewriteEngine On
RewriteRule ^hotel/(.*)(.*).php /nilesh/u/hotel.php?id=1&name=Pakwan

After writing this code when I have run my site It show no change nor it have given any error.

can u tell me how can v know that our .htaccess file is enable.

or if there is any other error in my code.
Am I correct to assume that http://vishal/nilesh/URL/hotel.php/1/Pakwan does not work?
Jun 11 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: namemattersnot | last post by:
ok. i give up. need help :) here's the rule: RewriteRule ^test/(.+)/(.*)$ /index.php$2 if i request: http://localhost/test/keyword/?show=files it properly redirects me. NOW, if i change...
11
by: joelbyrd | last post by:
I have a people-networking type site in which each user has their own profile page, with their user id encoded. So, for example, the web address of their page might look like...
4
by: Hermann.Richter | last post by:
I want to rewrite URLs like http://domain/dir/file.php?var1=val1&var2=val2#anchor to http://domain/dir/file?var1=val1&var2=val2#anchor In other words, I want to strip out the php extension ...
0
by: narian | last post by:
Hi, I am trying to convert urls from this format: http://localhost/index.php?section=11 (where 11 is the id of the row in a table) to this friendly url: http://localhost/services.html...
3
by: dennis.sprengers | last post by:
* I'm trying to work out some rewrite rules that should do the following: case 1: a request to mysite.com: rewrite http://www.mysite.com/files/sheets.ppt to...
7
by: k3pp0 | last post by:
Hello. I'm trying to make use of "pretty URLs" with Apache's rewrite module. Here's what I want: http://foo.bar/index.php?download should be replaced with
11
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
With Apache's mod_rewrite module I can keep *.php files and load them as *.html files: # Make http//example.com/foo/bar.html load /home/site/foo/bar.php RewriteEngine On RewriteRule...
7
by: Dale | last post by:
again, i know this is OT...just move along to the next post if it bugs you. :) i had been trying to have this: project.66.204.32.110 from the client browser, map to a virtual host where the...
2
by: LC's No-Spam Newsreading account | last post by:
On Tue, 7 Oct 2008, Grant wrote: I carefully RTFM, but can't find an example like my case. What is the " fake directory cgi option" ? (in general I avoid using /cgi-bin or personal...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.