42 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for mattster

Dear All, This must be a very common problem, but yet nowhere on the internet wishes to display a working answer. I am in a sticky situation. I have the following .htaccess file on my local webserver: http://localhost/testsite/.htaccess DirectoryIndex home.php?view=home RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} …

Member Avatar for mattster
0
350
Member Avatar for vaultdweller123

hello im a little new to htaccess specially mod_rewrite, i know mod_rewrite allows us to rewrite request. Can anyone write me the exact code how to rewrite my path to files?. Before my files(jc,css,images..etc.) reside in example /images/image.png, but now it has a parent directory folder named "public" so my …

Member Avatar for cereal
0
344
Member Avatar for fheppell

I have a problem with one of my php scripts. I've got a file called view.php. If I go to test.com/view?id=7575 it comes up with a 404 error. However if I go to test.com/view.php?id=7575 it works. Why is this?

Member Avatar for gogs85
0
204
Member Avatar for Tinnin

Hi all, I am running through the book "PHP Advanced and Object Oriented Programming" by Larry Ullman and I am currently trying to use a mod_rewrite to change my GETs to look like standard URLs. I am running the site on my localhost. My .htaccess file is being read (tested …

Member Avatar for Tinnin
0
223
Member Avatar for rohanbajaj222

hii, i have some dynamic urls which are indexed by google , but all my urls are static as generated by htaccess, dont know how those urls got indexed, so whenever some one visits through google , he cant get page 2 on same url,as that generates 404 error eg …

Member Avatar for diafol
0
174
Member Avatar for rohanbajaj222

my url keys are coming from database , say if my url is abc.com ,i have used a rewrite rule RewriteRule (.*)/(.*)/mcqs/(.*)/(.*)/(.*)\.html mcq.php?mcq_id=$4&page=$5 in this rewrite rule , first four (.*) are coming as url keys from db, but problem is that in address bar am able to add any …

Member Avatar for LastMitch
0
371
Member Avatar for randomkid73

Hi all, I'm having some issues with RewriteRules conflicting in my .htacccess file. For starters, here's the file: <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On #Start forum rules RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] #Start wiki rules RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php …

Member Avatar for randomkid73
0
206
Member Avatar for lukas.vandendijssel

This .htaccess throws me a 500 error. I've Googled/tried everything. RewriteEngine on RewriteRule ^([0-9]{6})$ decode.php?shorturl=$1 [L] It's for a URL shortener. I am new to this stuff.

Member Avatar for diafol
0
438
Member Avatar for DaveyMoyes

Hi Everyone. I have a htaccess file the re-writes my urls for a directory on a website I am helping to develop for a friend. the directory structure is mydomain.co.uk/dir1/dir2/shopping-cart/ The mod_rewrite rule rewrites the index.php file into pretty urls for example: shopping-cart/123/this-is-the-item-title The problem I am facing is when …

Member Avatar for gon1387
0
296
Member Avatar for mohamedasif18

Hi Guyz, Am facing an issue that $_GET[] not working in my Mod_Rewrite, My Odd URL is : http://groupon.ig-demo.com/index.php?id=12&dealname=Oil%20Treatment My Friendly URL is : http://groupon.ig-demo.com/id/12/Oil%20Treatment.htm And My HTACCESS is : Options +FollowSymlinks DirectoryIndex index.php RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] RewriteRule ^id/([^/]*)/([^/]*)\.htm$ …

Member Avatar for diafol
0
296
Member Avatar for afroo.gfx

I Need Help With My **.htaccess** file .. Now i have link like that http://www.afrogfx.com/20121028050853/Test.html problem located with **Slash /** !! if you click on my link you will found link without style if remove slash you will get 404 Not Found Like That http://www.afrogfx.com/20121028050853Test.html Try it !! **Here Is …

Member Avatar for Squidge
0
277
Member Avatar for oksam

I have used following mod_rewrite rules: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %(REQUEST_FILENAME) !-l RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] to get **www.myweb.com/newyork** from **www.myweb.com/index.php?url=newyork.** Now I trying to get pretty url for this page www.myweb.com/itemdetail?itemid=1000 to www.myweb.com/itemdetail/1000 I have been trying several mod_rewrite rules, but I have not …

Member Avatar for pritaeas
0
153
Member Avatar for rgutierrez1014

I'm using a code snippet from the Invision Power Board forum software on my own site to, sort of, connect the two. I have a "member bar" that I wanna put on every page in my website that has a login link, profile link, etc. I've already done this, the …

Member Avatar for almostbob
0
271
Member Avatar for johnnycho

My question requires a little background first: I'm working on a Web project where there are four theatres owned by a single company, so not only will the four theatres each need their own Website (each with its own unique branding), but the umbrella company will need one as well. …

Member Avatar for knssanthan
0
235
Member Avatar for saadi06

Hi, I am using opencart and I want to rewrite a url through htaccess. I have tried to rewrite the url but it redirects me to the "page not found" page. I have tried to rewrite the url using the following pattern RewriteRule product/detail/(.*)/$ /index.php?route=pro/det&photo_id=$1 Please help. Thanks in advance.

Member Avatar for Dani
0
197
Member Avatar for oksam

I am trying to give each MOVIE there own url name, for example, [url]www.helloworld.com/BATMAN[/url]. I have been using mod_rewrite to create such url. I have been using following htaccess code to achieve such result. RewriteEngine ON RewriteCond %(REQUEST_FILENAME) !-d RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-l RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] The …

Member Avatar for oksam
0
297
Member Avatar for bsewell

Hello, I want to make a simple website, and friendly urls would be a great step towards that. I have been trying this for 2 days without success. [url]www.mydomain.com/join[/url] redirects to [url]www.mydomain.com/index.php?path1=join[/url] [url]www.mydomain.com/forum[/url] redirects to [url]www.mydomain.com/index.php?path1=forum[/url] [url]www.mydomain.com/forum/getting-started[/url] redirects to [url]www.mydomain.com/index.php?path1=forum&path2=getting-started[/url] These directories do not actually exist. They are going to …

0
135
Member Avatar for wimmer

This is the first time I have ever tried to use mod_rewrite and have been stuck for a couple days. I am trying to change [url]www.mysite.com/example6.php?id=games[/url] to [url]www.mysite.com/example6/games[/url] Is this even achievable? Any advice will be very much appreciated!

Member Avatar for somedude3488
0
223
Member Avatar for klemme

On my site when a link is clicked, the adress bar in the browser shows this URL: [CODE] http://www.enkelt-webdesign.dk/index.php?sid=1&titel=FORSIDE [/CODE] I would lke the URL to appear like this: [B][url]http://www.enkelt-webdesign.dk/Forside[/url][/B] I have this code in my .htacess file which is not working as it is: [CODE] <ifModule mod_rewrite.c> RewriteEngine on …

Member Avatar for tiggsy
0
281
Member Avatar for jogesh_p

hello friends, i trying to change the extension .php into .html in my local server but it still shows the .php extension. i have test.php and after the mod_rewrite it just show the test.php but if i type in url test.html then it also show the same content of test.php, …

Member Avatar for cereal
0
142
Member Avatar for jrotunda85

I am in the process of trying to customize my site's URLs and I'm running into an issue with my htaccess file, specifically the newest one I am trying to add. Here's the file -- [CODE]RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA] RewriteRule ^/retail/(.*)$ retail.php?id=$1[/CODE] …

0
139
Member Avatar for klemme

Hi all, I am posting this thread to learn a bit of how mod_rewrite works. I want to specificly learn to make dynamic urls from websites, become seo friendly: [B]MADE UP LINK, DONT FOLLOW[/B] [url]www.sitename.php/index.php?sid=2&pid=231[/url] [B]MADE UP LINK, DONT FOLLOW[/B] look like: [url]www.sitename/furnitures/sofas[/url] And learn how to prevent duplicate content …

Member Avatar for madCoder
0
189
Member Avatar for thedonedeal

Is there a way to write a line in .htaccess so that a rewrite rule will NOT rewrite the URL if a certain query_string is found or if a certain page is referring to the page about to be rewritten?

0
111
Member Avatar for jakizak

Ahhhh! OK, so I've been learning PHP for about 7 years now on and off, but never have I taken the time to look into URL rewriting. Until now I've not needed it, but you can guarantee the one thing you think you wont need, you need! I have the …

Member Avatar for blocblue
0
351
Member Avatar for codemonkey88

Does anyone know about cleaning up URLs for CMS? I had a .htaccess file containing the following code (or so far as I can remember) [CODE] RewriteEngine On RewriteRule ^([a-z])$ /index.php?url=$1 [L] RewriteRule ^/article/([a-z])$ /index.php?url=$1&type=news [L] [/CODE] which was working fine ie: [url]www.mysite.com/somepage[/url] loaded the "mypage" content into my index.php …

Member Avatar for codemonkey88
0
249
Member Avatar for mgranger96

I'm working on generating SEO friendly URLs from data taken from a database. I've been successful for the most part. The only issue I'm having is when I stripped the spaces and made them dashes, I lose the data being pulled from the database. If I leave the spaces in …

Member Avatar for mgranger96
0
218
Member Avatar for darkslide

Hello, i have a question about mod_rewrite. I have the following url: [url]www.example.com/listen.php?title=U2_with_or_without_you&youtube_video_id=hTgnDLWeeaM[/url] Now, i want to rewrite it like this: www.example.com/U2_with_or_without_you->hTgnDLWeeaM Now, my question is, since i can't use the caracters - or _ as separators between the get parameters, it is "safe" to use -> ? Is it …

Member Avatar for EvolutionFallen
0
224
Member Avatar for bjeffries

I am on a godaddy server now and trying this mod-rewrite stuff and it is still not working. I have been searching google now for hours looking for the answer and cannot find it. Here is my entire .htaccess file: #Rewrite Rules Options -MultiViews Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase …

Member Avatar for bjeffries
0
237
Member Avatar for reco21

Hello. I've set up pagination for my results. I do this with a class. I also have pretty urls with mod_rewrite. I'm wondering how to echo the urls for the paginated data. Currently I have this below for the links. [CODE]$links .= ' ' . $prefix . '<a href="' . …

Member Avatar for pritaeas
0
187
Member Avatar for wickedsunny

Hello, I did a little rewrite rule a little while ago to redirect ppl who directly access my site's image to image pages instead, for example a person accessing [url]www.mysite.com/i/asdf.jpg[/url] to [url]www.mysite.com/pic/asdf[/url] this is the rewrite rule i used : [CODE]location /i/image_(\d+).(gif|jpg|jpeg|png)$ { root /home/mysite/public_html; valid_referers www.mysite.com mysite.com; if ($invalid_referer) …

0
116

The End.